Added transform -> PhysX position presync
This commit is contained in:
@@ -168,6 +168,10 @@ pre_physx_sync :: (game_scene: *Scene) {
|
||||
physx_actor := parray_get(*game_scene.physx_scene.actors, it.physics.physx_handle);
|
||||
if physx_actor.type == {
|
||||
case .DYNAMIC; {
|
||||
// @Incomplete: Might wanna do this differently or at least not every frame?
|
||||
// We could potentially cache the last saved position and not update the pose, if PhysX is synced up
|
||||
pose := PhysX.PxTransform_new(*it.transform.position);
|
||||
PhysX.PxRigidActor_setGlobalPose(physx_actor.dynamic, *pose, true);
|
||||
PhysX.PxRigidDynamic_setLinearVelocity(physx_actor.dynamic, *it.physics.velocity, true);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user