This project has moved and is read-only. For the latest updates, please go here.

One-sided collisiondetection possible?

Oct 4, 2007 at 10:01 AM
Been looking over the demos and they are to the most extent very intuative. One thing I stumpled upon was the setup of defining collision-groups for every object and having objects react, even if defined as .None, as long as other objects are defined to collide. Would making 'super objects' that only affect but doesn't, perhaps temporarly, recieves no force from impacts from others harder to do, unless ofcourse I'm missing something obious whch is a probability since it's the first day with the engine.

Good job btw.

Oct 4, 2007 at 11:34 AM
So you want to make Newton roll over in his grave by having an action without an equal and opposite reaction? :-) Am I understanding you correctly?

I'm not sure that is currently possible. Geometries have a "CollisionResponseEnabled" property, but it will cancel the collision response on both itself and the geometry it collides with.

I did make the collide = true override collide = false for the collision category stuff, but changing that won't give you the 'super object' you mention.

Possibly there is some workaround to give you what you want but I can't think of one at the moment.
Oct 4, 2007 at 11:53 AM
The option would be nice from a gamecreators point of view. :D

Imagine a larger enemy/item/object pushing away the smaller ones without being affected itself.

Completely unrealistic, I agree. But in a way that is what I thought the 'doublesided declaration' would allow.
Oct 4, 2007 at 2:16 PM
This kind of collision happens all the time with realistic physics. You would just have to make the mass of the "super object" much greater than the mass of the colliding objects.
I guess you would then have to scale forces that you DID want to affect the super object, but maybe it would work for your application.

Another idea, I don't know if this is possible within the Farseer engine, as I haven't really used it much yet, but maybe right before the collision effects are carried out, you could make the super object static, while at the same time preserving relevant state information like velocity in some variables. Then, after the collision, you could make the object dynamic again and restore it's state from before. This might cause skipping behavior or something, but maybe it's worth a try.
Oct 4, 2007 at 5:33 PM
I agree, the 'pushing objects away' affect could be done by setting your masses correctly.

I'm not sure on the second idea but it might be worth trying.