Esempio n. 1
0
 /// <summary>
 /// Initialize using a position vector and a rotation matrix.
 /// </summary>
 /// <param name="position"></param>
 /// <param name="R"></param>
 public Transform(Vector2 position, Quaternion rotation)
 {
     this.position = position;
     this.rotation = rotation;
 }
Esempio n. 2
0
 /// <summary>
 /// Multiply a matrix transpose times a vector. If a rotation matrix is provided,
 /// then this Transforms the vector from one frame to another (inverse Transform).
 /// </summary>
 public static Vector2 MulT(Mat22 A, Vector2 v)
 {
     return(new Vector2(Vector2.Dot(v, A.Col1), Vector2.Dot(v, A.Col2)));
 }
Esempio n. 3
0
 /// <summary>
 /// Initialize using a position vector and a rotation matrix.
 /// </summary>
 /// <param name="position"></param>
 /// <param name="R"></param>
 public Transform(Vector2 position, Mat22 rotation)
 {
     this.position = position;
     this.rotation = rotation;
 }
Esempio n. 4
0
 /// <summary>
 /// Multiply a matrix times a vector. If a rotation matrix is provided,
 /// then this Transforms the vector from one frame to another.
 /// </summary>
 public static Vector2 Mul(Mat22 A, Vector2 v)
 {
     return(new Vector2(A.Col1.X * v.X + A.Col2.X * v.Y, A.Col1.Y * v.X + A.Col2.Y * v.Y));
 }
Esempio n. 5
0
 /// <summary>
 /// Initialize using a position vector and a rotation matrix.
 /// </summary>
 /// <param name="position"></param>
 /// <param name="R"></param>
 public XForm(Vec2 position, Mat22 rotation)
 {
     Position = position;
     R        = rotation;
 }
Esempio n. 6
0
 /// Set this based on the position and angle.
 public void Set(Vector2 p, float angle)
 {
     position = p;
     R        = new Mat22(angle);
 }
Esempio n. 7
0
 /// <summary>
 /// Set this to the identity transform.
 /// </summary>
 public void SetIdentity()
 {
     position = Vector2.Zero;
     R        = Mat22.Identity;
 }
Esempio n. 8
0
 /// <summary>
 /// Initialize using a position vector and a rotation matrix.
 /// </summary>
 /// <param name="position"></param>
 /// <param name="R"></param>
 public XForm(Vector2 p, Mat22 rotation)
 {
     position = p;
     R        = rotation;
 }