예제 #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;
 }
예제 #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)));
 }
예제 #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;
 }
예제 #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));
 }
예제 #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;
 }
예제 #6
0
 /// Set this based on the position and angle.
 public void Set(Vector2 p, float angle)
 {
     position = p;
     R        = new Mat22(angle);
 }
예제 #7
0
 /// <summary>
 /// Set this to the identity transform.
 /// </summary>
 public void SetIdentity()
 {
     position = Vector2.Zero;
     R        = Mat22.Identity;
 }
예제 #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;
 }