Ejemplo n.º 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);
        }
Ejemplo n.º 2
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;
 }
Ejemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="t0"></param>
 /// <param name="t1"></param>
 public static Orient3d Multiply(ref Orient3d t0, ref Orient3d t1)
 {
     return(t0.Apply(t1));
 }
Ejemplo n.º 4
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="orient"></param>
 /// <param name="point"></param>
 /// <returns></returns>
 public static Vec3d Multiply(ref Orient3d orient, Vec3d point)
 {
     return(orient.Apply(point));
 }
Ejemplo n.º 5
0
 /// <summary>
 /// Applies the inverse of this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public Orient3d ApplyInverse(Orient3d other)
 {
     other.Rotation    = Rotation.ApplyInverse(other.Rotation);
     other.Translation = ApplyInverse(other.Translation);
     return(other);
 }
Ejemplo n.º 6
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="t0"></param>
 /// <param name="t1"></param>
 /// <returns></returns>
 public static Orient3d CreateRelative(ref Orient3d t0, ref Orient3d t1)
 {
     return(t1.Apply(t0.Inverse));
 }
Ejemplo n.º 7
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="from"></param>
 /// <param name="to"></param>
 /// <returns></returns>
 public static Orient3d CreateFromTo(ref Orient3d from, ref Orient3d to)
 {
     return(to.Apply(from.Inverse));
 }
Ejemplo n.º 8
0
 /// <summary>
 /// Creates a relative transformation from t0 to t1.
 /// </summary>
 /// <param name="t0"></param>
 /// <param name="t1"></param>
 /// <returns></returns>
 public static Orient3d CreateRelative(Orient3d t0, Orient3d t1)
 {
     return(CreateRelative(ref t0, ref t1));
 }
Ejemplo n.º 9
0
 /// <summary>
 /// Applies the inverse of this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public Orient3d ApplyInverse(Orient3d other)
 {
     ApplyInverse(ref other);
     return(other);
 }
Ejemplo n.º 10
0
 /// <summary>
 /// Applies the inverse of this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public void ApplyInverse(ref Orient3d other)
 {
     Rotation.ApplyInverse(ref other.Rotation);
     other.Translation = ApplyInverse(other.Translation);
 }
Ejemplo n.º 11
0
 /// <summary>
 /// Applies this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public Orient3d Apply(Orient3d other)
 {
     Apply(ref other);
     return(other);
 }
Ejemplo n.º 12
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="other"></param>
 /// <param name="tolerance"></param>
 /// <returns></returns>
 public bool ApproxEquals(ref Orient3d other, double tolerance = SlurMath.ZeroTolerance)
 {
     return
         (Translation.ApproxEquals(other.Translation, tolerance) &&
          Rotation.ApproxEquals(ref other.Rotation, tolerance));
 }
Ejemplo n.º 13
0
 /// <summary>
 /// Applies the inverse of this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public void ApplyInverse(ref Orient3d other, ref Orient3d result)
 {
     Rotation.ApplyInverse(ref other.Rotation, ref result.Rotation);
     result.Translation = ApplyInverse(other.Translation);
 }
Ejemplo n.º 14
0
 /// <summary>
 /// Applies the inverse of this transformation to the given transformation in place.
 /// </summary>
 /// <param name="other"></param>
 public void ApplyInverse(ref Orient3d other)
 {
     ApplyInverse(ref other, ref other);
 }
Ejemplo n.º 15
0
 /// <summary>
 /// Applies this transformation to the given transformation in place.
 /// </summary>
 /// <param name="other"></param>
 public void Apply(ref Orient3d other)
 {
     Apply(ref other, ref other);
 }