Beispiel #1
0
        /// <summary>
        ///
        /// </summary>
        /// <param name="eye"></param>
        /// <param name="target"></param>
        /// <param name="up"></param>
        /// <returns></returns>
        public static Orient3d CreateLookAt(Vec3d eye, Vec3d target, Vec3d up)
        {
            var rot = new Rotation3d(target - eye, up);

            rot.SwapZX();

            var orient = new Orient3d(rot, eye);

            orient.Invert();

            return(orient);
        }
Beispiel #2
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="r0"></param>
 /// <param name="r1"></param>
 public static Rotation3d CreateRelative(ref Rotation3d r0, ref Rotation3d r1)
 {
     return(r1.Apply(r0.Inverse));
 }
Beispiel #3
0
 /// <summary>
 /// Creates a relative rotation from r0 to r1.
 /// </summary>
 /// <param name="r0"></param>
 /// <param name="r1"></param>
 /// <returns></returns>
 public static Rotation3d CreateRelative(Rotation3d r0, Rotation3d r1)
 {
     return(CreateRelative(ref r0, ref r1));
 }
Beispiel #4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="r0"></param>
 /// <param name="r1"></param>
 public static Rotation3d Multiply(ref Rotation3d r0, ref Rotation3d r1)
 {
     return(r0.Apply(r1));
 }
Beispiel #5
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="rotation"></param>
 /// <param name="vector"></param>
 public static Vec3d Multiply(ref Rotation3d rotation, Vec3d vector)
 {
     return(rotation.Apply(vector));
 }
Beispiel #6
0
 /// <summary>
 /// Applies the inverse of this rotation to the given rotation.
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public Rotation3d ApplyInverse(Rotation3d other)
 {
     other.SetXY(ApplyInverse(other._x), ApplyInverse(other._y));
     return(other);
 }
Beispiel #7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="scale"></param>
 /// <param name="orientation"></param>
 public Transform3d(Vec3d scale, Orient3d orientation)
 {
     Scale       = scale;
     Rotation    = orientation.Rotation;
     Translation = orientation.Translation;
 }
Beispiel #8
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="scale"></param>
 /// <param name="rotation"></param>
 /// <param name="translation"></param>
 public Transform3d(Vec3d scale, Rotation3d rotation, Vec3d translation)
 {
     Scale       = scale;
     Rotation    = rotation;
     Translation = translation;
 }
Beispiel #9
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="origin"></param>
 /// <param name="x"></param>
 /// <param name="y"></param>
 public Orient3d(Vec3d origin, Vec3d x, Vec3d y)
 {
     Rotation    = new Rotation3d(x, y);
     Translation = origin;
 }
Beispiel #10
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="rotation"></param>
 /// <param name="translation"></param>
 public Orient3d(Rotation3d rotation, Vec3d translation)
 {
     Rotation    = rotation;
     Translation = translation;
 }
Beispiel #11
0
 /// <summary>
 /// Applies the inverse of this rotation to the given rotation.
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public void ApplyInverse(ref Rotation3d other)
 {
     other.SetXY(ApplyInverse(other._x), ApplyInverse(other._y));
 }
Beispiel #12
0
 /// <summary>
 /// Applies the inverse of this rotation to the given rotation.
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public Rotation3d ApplyInverse(Rotation3d other)
 {
     ApplyInverse(ref other);
     return(other);
 }
Beispiel #13
0
 /// <summary>
 /// Applies this rotation to the given rotation.
 /// </summary>
 /// <param name="other"></param>
 /// <returns></returns>
 public Rotation3d Apply(Rotation3d other)
 {
     Apply(ref other);
     return(other);
 }
Beispiel #14
0
 /// <summary>
 /// http://www.euclideanspace.com/maths/geometry/rotations/conversions/matrixToAngle/index.htm
 /// </summary>
 /// <param name="rotation"></param>
 public AxisAngle3d(ref Rotation3d rotation)
     : this()
 {
     throw new NotImplementedException();
 }