Merge branch 'px_kinematic_move_fix' of https://github.com/GoaLitiuM/FlaxEngine into GoaLitiuM-px_kinematic_move_fix
This commit is contained in:
@@ -2260,7 +2260,13 @@ void PhysicsBackend::SetRigidActorPose(void* actor, const Vector3& position, con
|
||||
if (kinematic)
|
||||
{
|
||||
auto actorPhysX = (PxRigidDynamic*)actor;
|
||||
actorPhysX->setKinematicTarget(trans);
|
||||
if (actorPhysX->getActorFlags() & PxActorFlag::eDISABLE_SIMULATION)
|
||||
{
|
||||
// Ensures the disabled kinematic actor ends up in the correct pose after enabling simulation
|
||||
actorPhysX->setGlobalPose(trans, wakeUp);
|
||||
}
|
||||
else
|
||||
actorPhysX->setKinematicTarget(trans);
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user