Example #1
0
 public static Vector3F Cross(Vector3F l, Vector3F r)
 {
     return new Vector3F(
         l.Y * r.Z - l.Z * r.Y,
         l.Z * r.X - l.X * r.Z,
         l.X * r.Y - l.Y * r.X);
 }
Example #2
0
 /// <summary>
 /// Reads object data from given BinaryReader.
 /// </summary>
 public new void Read(BinaryReader br)
 {
     Center = new Vector3F(br);
     Ox = new Vector3F(br);
     Oy = new Vector3F(br);
     Oz = new Vector3F(br);
 }
Example #3
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;
 }
Example #4
0
 public static Vector3F Min(Vector3F l, Vector3F r)
 {
     return new Vector3F(
         l.X < r.X ? l.X : r.X,
         l.Y < r.Y ? l.Y : r.Y,
         l.Z < r.Z ? l.Z : r.Z
     );
 }
Example #5
0
 public static Vector3F Max(Vector3F l, Vector3F r)
 {
     return new Vector3F(
         l.X > r.X ? l.X : r.X,
         l.Y > r.Y ? l.Y : r.Y,
         l.Z > r.Z ? l.Z : r.Z
     );
 }
Example #6
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();
     }
 }
Example #7
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);
 }
Example #8
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;
 }
Example #9
0
 public Vertex(Vector3F position, Vector3F normal, Vector2F texCoord)
 {
     Init(position, normal, texCoord);
 }
Example #10
0
 /// <summary>
 /// Reads object data from given BinaryReader.
 /// </summary>
 public new void Read(BinaryReader br)
 {
     Center = new Vector3F(br);
     Radius = br.ReadSingle();
 }
Example #11
0
 /// <summary>
 /// Reads object data from given BinaryReader.
 /// </summary>
 public void Read(BinaryReader br)
 {
     Rotation = new QuaternionF(br);
     Translation = new Vector3F(br);
 }
Example #12
0
 public static float Dot(Vector3F l, Vector3F r)
 {
     return r.X * l.X + r.Y * l.Y + r.Z * l.Z;
 }