[SOLVED] Kinematic Actor collision with dynamic Actor

Xenomorph

07-05-2010 19:14:21

Hi there,
I have a little problem. In my project I have a helicopter that's controlled by the user and it's a kinematic actor. Then I have other vehicles like tanks in my scene which are dynamic actors.
I was trying to set the mass of the tanks like this:
NxOgre::RigidBodyDescription desc;
desc.mMass = 69540;
mActor = mScene->createActor(..., desc);

Now the problem is when i crash into the tanks for example with my helicopter they fly around like they were rubber balls. I'm wondering if this is beause the Kinematic Actor has like an infinite mass or because the mass for the tanks wasn't set correctly.
So, I would like to know what I have to do to make this collision more realistic.
Is there also a way to disable my Kinematic Actors collision with other dynamic actors? What I need is like that a collision callback is called when it collides so I can do stuff, but no physical reaction happens, like the tank falls over or something like that. Is that possible?
Also, one more thing. My Kinematic actor goes through the HeightFieldGeometry. How can I prevent that? My dynamic actors stay on top, but my kinematic actor goes right through it.
Thanks in advance!

betajaen

07-05-2010 19:30:06

Mass really doesn't come into it, Kinematic Actors have no momentum - meaning if it collides with something the collision normal is cancelled out, so it can go through things. Imagine a helicopter trying to go through a huge concrete wall without reducing it's velocity or shape, it would explode whilst the helicopter keeps on going forward. ;)

You could perform a intersection or sweep test around the helicopter every frame. Problem is then your doing the collision checking and response manually, which is the pointless since the physics engine should do that for you.

I recommend you make it a dynamic body myself. The collisions should be correct with the tanks and height fields. Keeping the helicopter in the air shouldn't be too difficult; it's just forces, and it would look a bit more realistic in motion.