public void QueueLine(Vector3 p1, Vector3 p2, Color color) { int count = LineVertices.Count; LineVertices.Add(new VertexPositionColor(p1, color)); LineVertices.Add(new VertexPositionColor(p2, color)); LineIndices.Add((ushort)count); LineIndices.Add((ushort)(count + 1)); }
public void QueueLine(Vector2 p1, Vector2 p2, float depth, Color color) { int count = LineVertices.Count; LineVertices.Add(new VertexPositionColor(new Vector3(p1, depth), color)); LineVertices.Add(new VertexPositionColor(new Vector3(p2, depth), color)); LineIndices.Add((ushort)count); LineIndices.Add((ushort)(count + 1)); }
public bool Equals(LineIndices p) { // If parameter is null return false. if ((object)p == null) { return(false); } // Return true if the fields match: return((v1 == p.v1) && (v2 == p.v2)); }
public void QueueLineStrip(IEnumerable <Vector2> points, float depth, Color color) { int count = LineVertices.Count; int num = 0; foreach (Vector2 point in points) { LineVertices.Add(new VertexPositionColor(new Vector3(point, depth), color)); num++; } for (int i = 0; i < num - 1; i++) { LineIndices.Add((ushort)(count + i)); LineIndices.Add((ushort)(count + i + 1)); } }
public void QueueRectangle(Vector2 corner1, Vector2 corner2, float depth, Color color) { int count = LineVertices.Count; LineVertices.Add(new VertexPositionColor(new Vector3(corner1.X, corner1.Y, depth), color)); LineVertices.Add(new VertexPositionColor(new Vector3(corner1.X, corner2.Y, depth), color)); LineVertices.Add(new VertexPositionColor(new Vector3(corner2.X, corner2.Y, depth), color)); LineVertices.Add(new VertexPositionColor(new Vector3(corner2.X, corner1.Y, depth), color)); LineIndices.Add((ushort)count); LineIndices.Add((ushort)(count + 1)); LineIndices.Add((ushort)(count + 1)); LineIndices.Add((ushort)(count + 2)); LineIndices.Add((ushort)(count + 2)); LineIndices.Add((ushort)(count + 3)); LineIndices.Add((ushort)(count + 3)); LineIndices.Add((ushort)count); }
// Equals & GetHashCode override, as guideline [http://msdn.microsoft.com/en-us/library/bsc2ak47.aspx] public override bool Equals(System.Object obj) { // If parameter is null return false. if (obj == null) { return(false); } // If parameter cannot be cast to Type return false. LineIndices p = obj as LineIndices; if ((System.Object)p == null) { return(false); } // Return true if the fields match: return((v1 == p.v1) && (v2 == p.v2)); }
public bool Equals(LineIndices p) { // If parameter is null return false. if ((object)p == null) { return false; } // Return true if the fields match: return (v1 == p.v1) && (v2 == p.v2); }