Exemplo n.º 1
0
 /// <summary>
 /// Creates new instance of SkinVertex.
 /// Does not clone given classes and arrays.
 /// </summary>
 /// <param name="position"></param>
 /// <param name="normal"></param>
 /// <param name="texCoord"></param>
 /// <param name="jointIndices"></param>
 /// <param name="jointWeights"></param>
 public SkinVertex(Vector3F position, Vector3F normal, Vector2F texCoord, uint[] jointIndices, float[] jointWeights)
     : base(position, normal, texCoord)
 {
     if(jointIndices.Length != 4 || jointWeights.Length != 4)
         throw new Exception("Incorrect length of jointIndices or jointWeights");
     JointIndices = jointIndices;
     JointWeights = jointWeights;
 }
Exemplo n.º 2
0
 /// <summary>
 /// Reads object data from given BinaryReader.
 /// </summary>
 public void Read(BinaryReader br)
 {
     Position = new Vector3F(br);
     Normal = new Vector3F(br);
     TexCoord = new Vector2F(br);
     for (var i = 0; i < 4; i++)
     {
         JointIndices[i] = br.ReadUInt32();
     }
     for (var i = 0; i < 4; i++)
     {
         JointWeights[i] = br.ReadSingle();
     }
 }
Exemplo n.º 3
0
 /// <summary>
 /// Reads object data from given BinaryReader.
 /// </summary>
 public virtual void Read(BinaryReader br)
 {
     Position = new Vector3F(br);
     Normal = new Vector3F(br);
     TexCoord = new Vector2F(br);
 }
Exemplo n.º 4
0
 /// <summary>
 /// Used to initialize the Vertex using according data.
 /// </summary>
 /// <param name="position"></param>
 /// <param name="normal"></param>
 /// <param name="texCoord"></param>
 public void Init(Vector3F position, Vector3F normal, Vector2F texCoord)
 {
     Position = position;
     Normal = normal;
     TexCoord = texCoord;
 }
Exemplo n.º 5
0
 public Vertex(Vector3F position, Vector3F normal, Vector2F texCoord)
 {
     Init(position, normal, texCoord);
 }
Exemplo n.º 6
0
 public bool Equals(Vector2F other)
 {
     if (ReferenceEquals(null, other)) return false;
     if (ReferenceEquals(this, other)) return true;
     return other.X.Equals(X) && other.Y.Equals(Y);
 }