public List <int> CollectAABB(AABB bounds) { ReturnTriangles.Clear(); if (Bounds.Overlaps(ref bounds, 0)) { AABBTester rt = new AABBTester(); rt.box = bounds; TraverseNode(0, ref Bounds, rt); } return(ReturnTriangles); }
public override void Initialize() { base.Initialize(); A = new AABBTester(this, "A"); A.Render.Color = Color.Red; A.Physics.Restitution = .1f; A.Body.Position = new Vector2(20, EntityGame.Viewport.Height / 2f - A.Body.Height / 2f - 10); A.Physics.Velocity.X = 200; B = new AABBTester(this, "B"); B.Render.Color = Color.Blue; B.Physics.Restitution = .1f; B.Body.Position = new Vector2(EntityGame.Viewport.Width - 20 - B.Body.Width, EntityGame.Viewport.Height / 2f - B.Body.Height / 2f); B.Physics.Velocity.X = -200; }
public override void Initialize() { base.Initialize(); A = new AABBTester(this, "A"); A.Render.Color = Color.Red; A.Physics.Restitution = .1f; A.Body.Position = new Vector2(20, EntityGame.Viewport.Height / 2f - A.Body.Height / 2f); A.Physics.Velocity.X = 200; B = new AABBTester(this, "B"); B.Render.Color = Color.Blue; B.Physics.Restitution = .1f; B.Body.Position = new Vector2(EntityGame.Viewport.Width - 20 - B.Body.Width, EntityGame.Viewport.Height / 2f - B.Body.Height / 2f); B.Physics.Velocity.X = -200; }
public override void Initialize() { base.Initialize(); A = new AABBTester(this, "A"); A.Render.Color = Color.Red; A.Physics.Restitution = 0.1f; A.Body.Position = new Vector2(EntityGame.Viewport.Width / 2f - A.Body.Width / 2f, 20); A.Physics.Acceleration.Y = 10f; B = new AABBTester(this, "B"); B.Render.Color = Color.Blue; B.Physics.Restitution = 0.1f; B.Body.Position = new Vector2(EntityGame.Viewport.Width / 2f - B.Body.Width / 2f, EntityGame.Viewport.Height - 20 - B.Body.Height); B.Collision.Immovable = true; }
public override void Initialize() { base.Initialize(); A = new AABBTester(this, "A"); A.Render.Color = Color.Red; A.Physics.Restitution = 0.1f; A.Body.Position = new Vector2(EntityGame.Viewport.Width / 2f - A.Body.Width / 2f, 20); A.Physics.Acceleration.Y = 10f; B = new AABBTester(this, "B"); B.Render.Color = Color.Blue; B.Physics.Restitution = 0.1f; B.Body.Position = new Vector2(EntityGame.Viewport.Width / 2f - B.Body.Width / 2f, EntityGame.Viewport.Height - 20 - B.Body.Height); B.Collision.Immovable = true; }
public List<int> CollectAABB(AABB bounds) { ReturnTriangles.Clear(); if (Bounds.Overlaps(ref bounds, 0)) { AABBTester rt = new AABBTester(); rt.box = bounds; TraverseNode(0, ref Bounds, rt); } return ReturnTriangles; }