Exemplo 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 OrthoBasis3d(target - eye, up);

            rot.SwapZX();

            var orient = new Orient3d(rot, eye);

            orient.Invert();

            return(orient);
        }
Exemplo n.º 2
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));
 }
Exemplo n.º 3
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="other"></param>
 /// <param name="tolerance"></param>
 /// <returns></returns>
 public bool ApproxEquals(ref Orient3d other, double tolerance = zMath.ZeroTolerance)
 {
     return
         (Translation.ApproxEquals(other.Translation, tolerance) &&
          Rotation.ApproxEquals(ref other.Rotation, tolerance));
 }
Exemplo n.º 4
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);
 }
Exemplo n.º 5
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);
 }
Exemplo n.º 6
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, ref other);
     return(other);
 }
Exemplo n.º 7
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);
 }
Exemplo n.º 8
0
 /// <summary>
 /// Applies this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public Orient3d Apply(Orient3d other)
 {
     Apply(ref other, ref other);
     return(other);
 }
Exemplo n.º 9
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;
 }