partially solid object

Questions about the LÖVE API, installing LÖVE and other support related questions go here.
Forum rules
Before you make a thread asking for help, read this.
Post Reply
JJSax
Prole
Posts: 47
Joined: Fri Apr 04, 2014 3:59 am

partially solid object

Post by JJSax »

Hi everyone. I'm trying to find a way to create a physics object that doesn't interact solidly with other objects. Something where the two objects wont immediately bounce off each other, and be able to pass through but interacts a little.

This is a bit difficult to explain; sorry if it doesn't make sense. I'm trying to have a hoop interact a little with basketballs. I was thinking a rectangle object on a joint but I worry that they will occasionally go above the hoop and interact in wierd ways.
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: partially solid object

Post by raidho36 »

A hoop is completely solid, it's just it's a three-dimensional object with a hole in the middle, that's why balls can pass through it. I'm stating the obvious but you need a firm grasp of this. In 2d you can simply use a slice of this hoop - two rigidly connected circles - and draw a fake solid graphics of the hoop on top.

To answer your question properly, you create objects that don't respond to collisions automatically, instead you create a manual collision response function that takes the collision normals and depths and applies the displacement (to move objects out of each other) only partially, or whatever other method of collision interaction is suitable.
JJSax
Prole
Posts: 47
Joined: Fri Apr 04, 2014 3:59 am

Re: partially solid object

Post by JJSax »

raidho36 wrote: Wed Oct 02, 2019 9:24 pm A hoop is completely solid, it's just it's a three-dimensional object with a hole in the middle, that's why balls can pass through it. I'm stating the obvious but you need a firm grasp of this.
I mean I'm completely aware of that. But it has a special movement and interaction that is very different than the rim itself.

So it sounds like I would have to create a custom function for that and there isn't some sort of built in function to make it less interactive with other objects without filtering it entirely?
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: partially solid object

Post by raidho36 »

Yeah pretty much. Box2d is for simulating rigid objects, and being rigid implies being completely solid, but you can do something different with custom collision response functions. If your application is actually just a hoop physics in 2d then you should use a pair of solid circles at the edge of the hoop rim. There's also a sort of "layer" system but it's for switching collision detection between objects on and off entirely.
JJSax
Prole
Posts: 47
Joined: Fri Apr 04, 2014 3:59 am

Re: partially solid object

Post by JJSax »

raidho36 wrote: Wed Oct 02, 2019 11:15 pm If your application is actually just a hoop physics in 2d then you should use a pair of solid circles at the edge of the hoop rim.
Yeah, that part is already done. The net physics would just make it feel a lot more real. Is the function to filter what can collide fixture:setFilterData()? https://love2d.org/wiki/Fixture:setFilterData
User avatar
raidho36
Party member
Posts: 2063
Joined: Mon Jun 17, 2013 12:00 pm

Re: partially solid object

Post by raidho36 »

For net you should also use it's 2d slice equivalent. That is, a bunch of solid blocks connected in a flexible chain, and also distance-constrained with their opposite pair.
JJSax
Prole
Posts: 47
Joined: Fri Apr 04, 2014 3:59 am

Re: partially solid object

Post by JJSax »

raidho36 wrote: Thu Oct 03, 2019 11:16 am For net you should also use it's 2d slice equivalent. That is, a bunch of solid blocks connected in a flexible chain, and also distance-constrained with their opposite pair.
That's a fair idea. I think that would work the best.
Post Reply

Who is online

Users browsing this forum: Google [Bot] and 49 guests