fix: Static Rigidbodies Moving When Velocity or AngularVelocity Assigned
This commit is contained in:
parent
9556be6f17
commit
0ba6913a61
|
@ -97,6 +97,9 @@ public class PhysicsEngine2D : IPhysicsEngine2D
|
||||||
|
|
||||||
private static void StepRigidBody(IRigidBody2D rigidBody, float intervalDeltaTime)
|
private static void StepRigidBody(IRigidBody2D rigidBody, float intervalDeltaTime)
|
||||||
{
|
{
|
||||||
|
if (rigidBody.IsStatic)
|
||||||
|
return;
|
||||||
|
|
||||||
rigidBody.Transform.Position += rigidBody.Velocity * intervalDeltaTime;
|
rigidBody.Transform.Position += rigidBody.Velocity * intervalDeltaTime;
|
||||||
rigidBody.Transform.Rotation += rigidBody.AngularVelocity * intervalDeltaTime;
|
rigidBody.Transform.Rotation += rigidBody.AngularVelocity * intervalDeltaTime;
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue