Disable collision to specific physicBodies

Topics: User Forum
Mar 30, 2007 at 12:03 PM

Im currently trying to make a sci-fi helicopter game, and is using Farseer with the physics..

My idea is to have a helicopters body as one PhysicsBody and the helicopter engine as another body.

The problem is when i try to apply torque to the engine the body tries to follow (because of the collision).
I have tried to disable the collision detection on the engine, and this seems to work fine. But then the engines wont collide with the world..
And then my question after alot of nonsensens writing :)

Is there a way to disable the collision only between the helicopter body and engine?

Btw... A second question :)

If I set the position of the helicopter body to be the same as the engine body (body.PhysicsBody.Position = engine.PhysicsBody.Position;), it wont follow as expected. Because if I apply an Force to the engine the the body will be dragged behind.. I guess this may be because of diffrence mass settings on the two bodies, but is there a way to work around this?
I have tried to set the same mass of both the bodies.
And then if i apply an force, I apply it to both the bodies.
This seems to work ok, but the positions will not align, when for instance only the body collide with something or vice versa.

Tank you for your time.

Regards a big Farseer fan!
Apr 2, 2007 at 8:16 PM
You can set the "Collision Group" on you rigid bodies. Any bodies that are in the same collision group will not collide with eachother.

You need to do something like:
HelicopterBody.CollisionGroup = 55 '55 is arbitrary
EngineBody.CollisionGroup = 55

Now, these two objects will not collide with eachother but WILL collide with other objects.

I'm not real clear what you are trying to do with the engine and helicopter in the rest of your post. Why do you need two objects. Why not one object and apply forces to that... could you be more clear what you are trying to do?
Apr 12, 2007 at 12:17 AM
What if you don't want a rigid body to collide with anything?
Apr 12, 2007 at 7:20 PM
Hmm, guess I didn't get that in there yet. If you don't want collision, then you don't even need to use a "RigidBody" just a regular old "body" will do. Problem is, I don't currently have a way to add Body objects to the Simulator object. I've been meaning to add a BodyList and corresponding Add(body) functions so you could have non-collision bodies right along side of the rigid bodies.
You should be able to add this pretty easy your self...