public DrawPoint ( Jitter.LinearMath.JVector pos ) : void | ||
pos | Jitter.LinearMath.JVector | |
리턴 | void |
protected override void Draw(GameTime gameTime) { GraphicsDevice.Clear(new Color(63, 66, 73)); SetAllModelEffectParameters(); foreach (RigidBody body in world.RigidBodies) { DrawModel(body); } pointList.Clear(); lineList.Clear(); foreach (Constraint constr in world.Constraints) { constr.AddToDebugDrawList(lineList, pointList); } foreach (JVector v in pointList) { debugDrawer.DrawPoint(Conversion.ToXNAVector(v), Color.Red); } for (int i = 0; i < lineList.Count; i += 2) { debugDrawer.DrawLine(Conversion.ToXNAVector(lineList[i]), Conversion.ToXNAVector(lineList[i + 1]), Color.Blue); } display.DisplayText[1] = "Islandcount: " + world.Islands.Count.ToString(); base.Draw(gameTime); debugDrawer.PointList.Clear(); debugDrawer.LineList.Clear(); }
private void DrawJitterDebugInfo() { foreach (RigidBody body in World.RigidBodies) { DebugDrawer.Color = Color.Gray;//rndColors[cc % rndColors.Length]; body.DebugDraw(DebugDrawer); //DebugDrawer.DrawAabb(body.BoundingBox.Min, body.BoundingBox.Max, Color.Pink); //if (body.Shape.GetType() == typeof(PolygonShape)) //{ // var ch = body.Shape as PolygonShape; // JMatrix o = JMatrix.CreateRotationZ(body.Orientation); // foreach (var point in ch.vertices) // { // var t = JVector.Transform(point, o); // DebugDrawer.DrawPoint(t + body.Position); // } //} DebugDrawer.Color = Color.Red; foreach (Arbiter item in body.Arbiters) { foreach (var contact in item.ContactList) { DebugDrawer.DrawLine(contact.Position1, contact.Position1 + contact.Normal * 0.15f); DebugDrawer.DrawLine(contact.Position2, contact.Position2 + contact.Normal * 0.15f); DebugDrawer.DrawPoint(contact.Position1); DebugDrawer.DrawPoint(contact.Position2); } } } DebugDrawer.Color = Color.Blue; foreach (Spring spring in World.Springs) { spring.DebugDraw(DebugDrawer); } DebugDrawer.Color = Color.Red; foreach (Constraint c in World.Constraints) { c.DebugDraw(DebugDrawer); } }