fix: Static Rigidbodies Moving When Velocity or AngularVelocity Assigned

This commit is contained in:
Syntriax 2024-01-27 19:21:18 +03:00
parent 9556be6f17
commit 0ba6913a61
1 changed files with 3 additions and 0 deletions

View File

@ -97,6 +97,9 @@ public class PhysicsEngine2D : IPhysicsEngine2D
private static void StepRigidBody(IRigidBody2D rigidBody, float intervalDeltaTime)
{
if (rigidBody.IsStatic)
return;
rigidBody.Transform.Position += rigidBody.Velocity * intervalDeltaTime;
rigidBody.Transform.Rotation += rigidBody.AngularVelocity * intervalDeltaTime;
}