PhysX 3.2.4 Kinematic RigidDynamic Bug?

While I was experimenting with Kinematic actors, i found out that for some reason the collision of a kinematic actor and a dynamic actor only works when the eKINEMATIC flag is set before adding a shape to the kinematic actor.

Ex:
This works (collides with other objects)

m_pActor = physX->createRigidDynamic(PxTransform::createIdentity());
//eKINEMATIC flag set before adding shapes
m_pActor->setRigidDynamicFlag(PxRigidDynamicFlag::eKINEMATIC,true);

m_pActor->createShape(PxTriangleMeshGeometry(triangleMesh),*defaultMaterial);

While this code doesn’t (no collision with other objects)

m_pActor = physX->createRigidDynamic(PxTransform::createIdentity());
m_pActor->createShape(PxTriangleMeshGeometry(triangleMesh),*defaultMaterial);

//eKINEMATIC flag set after adding shapes
m_pActor->setRigidDynamicFlag(PxRigidDynamicFlag::eKINEMATIC,true);

Is this a bug?
Because there isn’t anything in the documentation about this ‘requirement’.

Hi,

I created a plugin for a game engine and there is a function that transforms a simple rigid body to a kinematic actor and the way back, so there should be no problem with creating the body, adding the shape and then raising the flag. When you move kinematic actors, you need to use setKinematicTarget. Perhaps that is your problem. If not, can you send a simplified example?

Yeah, well that’s why i think it’s a bug. You are able to change the Kinematic state at RunTime, so it shouldn’t be a problem setting the Kinematic flag after adding a shape to the actor. And yes, i’m using SetKinematicTarget(…). It’s just something i found out while experimenting with the kinematic actors. You should try it out, first with the flag set after adding the shape and then with the flag set before adding the shape (like the code in my first post). You’ll see that when you move it (using SetKinematicTarget ;) ) that it only collides with other pure-dynamics if the flag is set before adding the shape.

But i guess if you switch the flag at runtime, that everything will work out. But in this example, setting the flag once at initialization gives you this strange behaviour.