Tets1231
This commit is contained in:
@@ -63,9 +63,9 @@ public class PhysicsEngine2D : IPhysicsEngine2D
|
||||
continue;
|
||||
|
||||
if (colliders[colliderIX].BehaviourController.TryGetBehaviour(out IRigidBody2D? rigidX))
|
||||
rigidX.Velocity = -normal * rigidX.Velocity.Length();
|
||||
rigidX.Velocity = Vector2.Reflect(rigidX.Velocity, normal);
|
||||
if (colliders[colliderIY].BehaviourController.TryGetBehaviour(out IRigidBody2D? rigidY))
|
||||
rigidY.Velocity = normal * rigidY.Velocity.Length();
|
||||
rigidY.Velocity = Vector2.Reflect(rigidY.Velocity, normal);
|
||||
|
||||
// Console.WriteLine($"Collision");
|
||||
break;
|
||||
|
Reference in New Issue
Block a user