public DisplayEllipseSwingLimit(EllipseSwingLimit constraint, LineDrawer drawer) : base(drawer, constraint) { axis = new Line(Color.Red, Color.Red, drawer); myLines.Add(axis); //Create the lines that represent the outline of the limit. limitLines = new Line[limitFacetCount * 2]; for (int i = 0; i < limitFacetCount; i++) { limitLines[i * 2] = new Line(Color.DarkRed, Color.DarkRed, drawer); limitLines[i * 2 + 1] = new Line(Color.DarkRed, Color.DarkRed, drawer); } myLines.AddRange(limitLines); }
protected override void Initialize() { ModelDrawer = new InstancedModelDrawer(this); ConstraintDrawer = new LineDrawer(this); ConstraintDrawer.DisplayTypes.Add(typeof(GrabSpring), typeof(DisplayGrabSpring)); ConstraintDrawer.DisplayTypes.Add(typeof(MotorizedGrabSpring), typeof(DisplayMotorizedGrabSpring)); ContactDrawer = new ContactDrawer(this); BoundingBoxDrawer = new BoundingBoxDrawer(this); SimulationIslandDrawer = new SimulationIslandDrawer(this); base.Initialize(); }
public DisplayLinearAxisLimit(LinearAxisLimit constraint, LineDrawer drawer) : base(drawer, constraint) { aToConnection = new Line(Color.DarkBlue, Color.DarkBlue, drawer); bToConnection = new Line(Color.DarkBlue, Color.DarkBlue, drawer); error = new Line(Color.Red, Color.Red, drawer); //Corners axis = new Line(Color.DarkBlue, Color.DarkBlue, drawer); myLines.Add(aToConnection); myLines.Add(bToConnection); myLines.Add(error); myLines.Add(axis); }
public DisplayRevoluteLimit(RevoluteLimit constraint, LineDrawer drawer) : base(drawer, constraint) { topRight = new Line(Color.DarkBlue, Color.DarkBlue, drawer); top = new Line(Color.DarkBlue, Color.DarkBlue, drawer); topLeft = new Line(Color.DarkBlue, Color.DarkBlue, drawer); bottomRight = new Line(Color.DarkBlue, Color.DarkBlue, drawer); bottom = new Line(Color.DarkBlue, Color.DarkBlue, drawer); bottomLeft = new Line(Color.DarkBlue, Color.DarkBlue, drawer); middle = new Line(Color.DarkBlue, Color.DarkBlue, drawer); testAxis = new Line(Color.DarkRed, Color.DarkRed, drawer); myLines.Add(topRight); myLines.Add(top); myLines.Add(topLeft); myLines.Add(bottomRight); myLines.Add(bottom); myLines.Add(bottomLeft); myLines.Add(middle); myLines.Add(testAxis); }
public DisplayGrabSpring(GrabSpring constraint, LineDrawer drawer) : base(drawer, constraint) { error = new Line(Color.Red, Color.Red, drawer); myLines.Add(error); }
protected LineDisplayObjectBase(LineDrawer drawer) { Drawer = drawer; myLinesReadOnly = new ReadOnlyCollection <Line>(myLines); }
/// <summary> /// Constructs a new line. /// </summary> /// <param name="positionA">Initial position of the first vertex of the line.</param> /// <param name="positionB">Initial position of the second vertex of the line.</param> /// <param name="colorA">Initial color of the first vertex of the line.</param> /// <param name="colorB">Initial color of the second vertex of the line.</param> /// <param name="drawer">System responsible for drawing this line.</param> public Line(Microsoft.Xna.Framework.Vector3 positionA, Microsoft.Xna.Framework.Vector3 positionB, Color colorA, Color colorB, LineDrawer drawer) { this.drawer = drawer; drawer.GetNewLineIndex(out IndexA); IndexB = IndexA + 1; drawer.vertices[IndexA].Position = positionA; drawer.vertices[IndexA].Color = colorA; drawer.vertices[IndexB].Position = positionB; drawer.vertices[IndexB].Color = colorB; }