asddad
This commit is contained in:
parent
fd8964e58b
commit
94897a06a3
|
@ -46,7 +46,7 @@ public class Game1 : Game
|
||||||
|
|
||||||
protected override void LoadContent()
|
protected override void LoadContent()
|
||||||
{
|
{
|
||||||
engine = new PhysicsEngine2D();
|
engine = new PhysicsEngine2D() { IterationCount = 100 };
|
||||||
_spriteBatch = new SpriteBatch(GraphicsDevice);
|
_spriteBatch = new SpriteBatch(GraphicsDevice);
|
||||||
|
|
||||||
spriteBox = new Sprite() { Texture2D = Content.Load<Texture2D>("Sprites/Pixel") };
|
spriteBox = new Sprite() { Texture2D = Content.Load<Texture2D>("Sprites/Pixel") };
|
||||||
|
|
|
@ -54,13 +54,8 @@ public class PhysicsEngine2D : IPhysicsEngine2D
|
||||||
|
|
||||||
for (int i = colliders.Count - 1; i >= 0; i--)
|
for (int i = colliders.Count - 1; i >= 0; i--)
|
||||||
CheckCollisions(colliders[i], colliders, (collider1, collider2, collisionVertex) =>
|
CheckCollisions(colliders[i], colliders, (collider1, collider2, collisionVertex) =>
|
||||||
{
|
ResolveCollision(collider1, collider2, collisionVertex, intervalDeltaTime)
|
||||||
ResolveCollision(collider1, collider2, collisionVertex, intervalDeltaTime);
|
);
|
||||||
// ResolveCollision(collider2, collider1, collisionVertex, intervalDeltaTime);
|
|
||||||
|
|
||||||
// collider1.Recalculate();
|
|
||||||
// collider2.Recalculate();
|
|
||||||
});
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue