This commit is contained in:
Syntriax 2023-12-06 17:39:21 +03:00
parent fd8964e58b
commit 94897a06a3
2 changed files with 3 additions and 8 deletions

View File

@ -46,7 +46,7 @@ public class Game1 : Game
protected override void LoadContent()
{
engine = new PhysicsEngine2D();
engine = new PhysicsEngine2D() { IterationCount = 100 };
_spriteBatch = new SpriteBatch(GraphicsDevice);
spriteBox = new Sprite() { Texture2D = Content.Load<Texture2D>("Sprites/Pixel") };

View File

@ -54,13 +54,8 @@ public class PhysicsEngine2D : IPhysicsEngine2D
for (int i = colliders.Count - 1; i >= 0; i--)
CheckCollisions(colliders[i], colliders, (collider1, collider2, collisionVertex) =>
{
ResolveCollision(collider1, collider2, collisionVertex, intervalDeltaTime);
// ResolveCollision(collider2, collider1, collisionVertex, intervalDeltaTime);
// collider1.Recalculate();
// collider2.Recalculate();
});
ResolveCollision(collider1, collider2, collisionVertex, intervalDeltaTime)
);
}
}