If I change a kinematic actor to dynamic, then apply a force immediately :
actor->setRigidDynamicFlag(physx::PxRigidDynamicFlag::eKinematic, false);
actor->addForce(force);
will the force be applied to this dynamic actor in simulation ?
If I change a kinematic actor to dynamic, then apply a force immediately :
actor->setRigidDynamicFlag(physx::PxRigidDynamicFlag::eKinematic, false);
actor->addForce(force);
will the force be applied to this dynamic actor in simulation ?
Hello,
If the simulation is not running when setting the flag and adding the force then the code above will store the force so that it is applied to the velocity update in the next simulation.
If the simulation is running when toggling the kinematic flag and adding the force then you will need to wait for the current and next simulation step to complete before the force updates the velocity. There is, however, a bug in 3.2.3 and in earlier versions: if you switch kinematic state and then add a force while the simulation is running then on the next simulate step your applied force will be lost. This has been fixed in 3.2.4.
Thanks,
Gordon