Example #1
0
 /// <summary>
 /// Primitive copy constructor. Inheriting classes implementing a copy constructor must call this.
 /// </summary>
 /// <param name="primitive">Primitive to copy.</param>
 public Primitive(Primitive primitive)
 {
     vertexPositionColors = new List<VertexPositionColor>();
     vertexColors = new List<Color>();
     primitiveType = primitive.primitiveType;
     color = primitive.color;
     position = primitive.position;
     origin = primitive.origin;
     scale = primitive.scale;
     degrees = primitive.degrees;
     alpha = primitive.alpha;
     filled = primitive.filled;
     thickness = primitive.thickness;
 }
 /// <summary>
 /// Removes a primitive from the compound.
 /// </summary>
 public void Remove(Primitive primitive)
 {
     primitives.Remove(primitive);
 }
 /// <summary>
 /// Adds a primitive to the compound.
 /// </summary>
 public void Add(Primitive primitive)
 {
     primitives.Insert(0, primitive);
 }
 private static void _Draw(Primitive primitive)
 {
     if (primitive is CompoundPrimitive)
     {
         (primitive as CompoundPrimitive).Primitives.ForEach(p => _Draw(p));
     }
     else
     {
         DrawCount++;
         batch.Draw(primitive.PrimitiveType, primitive.TransformedVertexPositionColors);
     }
 }
 /// <summary>
 /// Draws a primitive.
 /// </summary>
 /// <param name="primitive">Primitive to draw.</param>
 internal static void Draw(Primitive primitive)
 {
     primitive.InitializeForDrawing();
     _Draw(primitive);
 }