This commit is contained in:
2026-05-15 00:23:18 -07:00
parent 7f39479948
commit f727fc968c
2 changed files with 7 additions and 1 deletions

View File

@ -460,6 +460,9 @@ class RigidBody extends iron.Trait {
transform.loc.set(tx, ty, tz, 1.0);
transform.rot.set(tRot.x(), tRot.y(), tRot.z(), tRot.w());
} else {
transform.loc.set(currentPos.x(), currentPos.y(), currentPos.z(), 1.0);
transform.rot.set(currentRot.x(), currentRot.y(), currentRot.z(), currentRot.w());
}
if (object.parent != null) {

View File

@ -495,8 +495,11 @@ class RigidBody extends Trait {
}
var active = physics.bodyInterface.IsActive(bodyId);
if (!active)
if (!active) {
// Activate body if sleeping
physics.bodyInterface.ActivateBody(bodyId);
return;
}
// Read position and rotation from Jolt into cached state
var p = physics.bodyInterface.GetPosition(bodyId);