示例#1
0
 /// <summary>
 /// Creates a new Vertex with values copied from another.
 /// </summary>
 public Vertex(Vertex clone)
 {
     Position    = clone.Position;
     BoneWeights = clone.BoneWeights;
     BoneIndices = clone.BoneIndices;
     Normal      = clone.Normal;
     UVs         = new List <Vector3>(clone.UVs);
     Tangents    = new List <Vector4>(clone.Tangents);
     Bitangent   = clone.Bitangent;
     Colors      = new List <VertexColor>(clone.Colors);
 }
            /// <summary>
            /// Creates a new Vertex with values copied from another.
            /// </summary>
            public Vertex(Vertex clone)
            {
                Position     = clone.Position;
                BoneWeights  = clone.BoneWeights;
                BoneIndices  = clone.BoneIndices;
                Normal       = clone.Normal;
                NormalW      = clone.NormalW;
                UVCount      = clone.UVCount;
                TangentCount = clone.TangentCount;
                //UVs = new List<Vector3>(clone.UVs);
                //Tangents = new List<Vector4>(clone.Tangents);
                Bitangent       = clone.Bitangent;
                Colors          = new List <VertexColor>(clone.Colors);
                UsesBoneIndices = clone.UsesBoneIndices;
                UsesBoneWeights = clone.UsesBoneWeights;

                uvQueue      = null;
                tangentQueue = null;
                colorQueue   = null;
            }
            /// <summary>
            /// Create a Vertex with null or empty values.
            /// </summary>
            public Vertex(int uvCapacity = 0, int tangentCapacity = 0, int colorCapacity = 0)
            {
                Position    = Vector3.Zero;
                BoneWeights = new VertexBoneWeights();
                BoneIndices = new VertexBoneIndices();
                Normal      = Vector3.UnitX;
                NormalW     = 0;
                Bitangent   = Vector4.UnitW;

                uvQueue      = null;
                tangentQueue = null;
                colorQueue   = null;

                UVCount      = 0;
                TangentCount = 0;
                //UVs = new List<Vector3>(uvCapacity);
                //Tangents = new List<Vector4>(tangentCapacity);
                //Colors = new List<VertexColor>(colorCapacity);
                //Tangents = null;
                Colors          = null;
                UsesBoneIndices = false;
                UsesBoneWeights = false;
            }