I have a rigid body component which has a field named enableGravity. This flag is synchronized with Physx objects before simulation:
rigidBody.actor->setActorFlag(PxActorFlag::eDISABLE_GRAVITY, !rigidBody.dynamicDesc.applyGravity); rigidBody.actor->wakeUp(); Once the gravity starts, I am not able to disable it. I tried to apply the "negative" gravity to it when gravity is disabled:
if (!rigidBody.dynamicDesc.applyGravity) { rigidBody.actor->addForce(-mScene->getGravity()); } But this does not zero out the force either.