Exemplo n.º 1
0
 /// <summary>
 /// Creates a new instance of the <see cref="ControlNode"/> class.
 /// </summary>
 /// <param name="position">The position of the control node.</param>
 /// <param name="active">Whether the control node is active.</param>
 /// <param name="squareSize">The size of the square.</param>
 public ControlNode(Vector3 position, bool active, float squareSize)
     : base(position)
 {
     Active = active;
     Above = new MeshNode(position + Vector3.forward * squareSize / 2f);
     Right = new MeshNode(position + Vector3.right * squareSize / 2f);
 }
Exemplo n.º 2
0
        /// <summary>
        /// Create a triangle mesh.
        /// </summary>
        /// <param name="a">First meshnode in the triangle.</param>
        /// <param name="b">Second meshnode in the triangle.</param>
        /// <param name="c">Third meshnode in the triangle.</param>
        private void CreateTriangle(MeshNode a, MeshNode b, MeshNode c)
        {
            if (vertices == null || triangles == null)
            {
                throw new Exception("Attempting to create a mesh before initialization");
            }

            // Add the triangle indices.
            triangles.Add(a.VertexIndex);
            triangles.Add(b.VertexIndex);
            triangles.Add(c.VertexIndex);
        }