Update
This commit is contained in:
@ -460,6 +460,9 @@ class RigidBody extends iron.Trait {
|
|||||||
|
|
||||||
transform.loc.set(tx, ty, tz, 1.0);
|
transform.loc.set(tx, ty, tz, 1.0);
|
||||||
transform.rot.set(tRot.x(), tRot.y(), tRot.z(), tRot.w());
|
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) {
|
if (object.parent != null) {
|
||||||
|
|||||||
@ -495,8 +495,11 @@ class RigidBody extends Trait {
|
|||||||
}
|
}
|
||||||
|
|
||||||
var active = physics.bodyInterface.IsActive(bodyId);
|
var active = physics.bodyInterface.IsActive(bodyId);
|
||||||
if (!active)
|
if (!active) {
|
||||||
|
// Activate body if sleeping
|
||||||
|
physics.bodyInterface.ActivateBody(bodyId);
|
||||||
return;
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
// Read position and rotation from Jolt into cached state
|
// Read position and rotation from Jolt into cached state
|
||||||
var p = physics.bodyInterface.GetPosition(bodyId);
|
var p = physics.bodyInterface.GetPosition(bodyId);
|
||||||
|
|||||||
Reference in New Issue
Block a user