示例#1
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="other"></param>
 /// <param name="tolerance"></param>
 /// <returns></returns>
 public bool ApproxEquals(ref Transform3d other, double tolerance = SlurMath.ZeroTolerance)
 {
     return
         (Translation.ApproxEquals(other.Translation, tolerance) &&
          Rotation.ApproxEquals(ref other.Rotation, tolerance) &&
          Scale.ApproxEquals(other.Scale, tolerance));
 }
示例#2
0
 /// <summary>
 /// Applies the inverse of this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public Transform3d ApplyInverse(Transform3d other)
 {
     other.Rotation    = Rotation.ApplyInverse(other.Rotation);
     other.Translation = ApplyInverse(other.Translation);
     other.Scale      /= Scale;
     return(other);
 }
示例#3
0
 /// <summary>
 /// Applies this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public Transform3d Apply(Transform3d other)
 {
     other.Rotation    = Rotation.Apply(other.Rotation);
     other.Translation = Apply(other.Translation);
     other.Scale      *= Scale;
     return(other);
 }
示例#4
0
 /// <summary>
 /// Creates relative transformation from t0 to t1.
 /// </summary>
 /// <param name="from"></param>
 /// <param name="to"></param>
 /// <returns></returns>
 public static Transform3d CreateFromTo(ref Transform3d from, ref Transform3d to)
 {
     return(to.Apply(from.Inverse));
 }
示例#5
0
 /// <summary>
 /// Applies the inverse of this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public void ApplyInverse(ref Transform3d other, ref Transform3d result)
 {
     Rotation.ApplyInverse(ref other.Rotation, ref result.Rotation);
     result.Translation = ApplyInverse(other.Translation);
     result.Scale       = other.Scale / Scale;
 }
示例#6
0
 /// <summary>
 /// Applies the inverse of this transformation to the given transformation in place.
 /// </summary>
 /// <param name="other"></param>
 public void ApplyInverse(ref Transform3d other)
 {
     ApplyInverse(ref other, ref other);
 }
示例#7
0
 /// <summary>
 /// Applies the inverse of this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public Transform3d ApplyInverse(Transform3d other)
 {
     ApplyInverse(ref other, ref other);
     return(other);
 }
示例#8
0
 /// <summary>
 /// Applies this transformation to the given transformation in place.
 /// </summary>
 /// <param name="other"></param>
 public void Apply(ref Transform3d other)
 {
     Apply(ref other, ref other);
 }
示例#9
0
 /// <summary>
 /// Applies this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public Transform3d Apply(Transform3d other)
 {
     Apply(ref other, ref other);
     return(other);
 }
示例#10
0
 /// <summary>
 /// Creates relative transformation from t0 to t1.
 /// </summary>
 /// <param name="t0"></param>
 /// <param name="t1"></param>
 /// <returns></returns>
 public static Transform3d CreateRelative(Transform3d t0, Transform3d t1)
 {
     return(CreateRelative(ref t0, ref t1));
 }
示例#11
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="t0"></param>
 /// <param name="t1"></param>
 public static Transform3d Multiply(ref Transform3d t0, ref Transform3d t1)
 {
     return(t0.Apply(t1));
 }
示例#12
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="transform"></param>
 /// <param name="point"></param>
 /// <returns></returns>
 public static Vec3d Multiply(ref Transform3d transform, Vec3d point)
 {
     return(transform.Apply(point));
 }
示例#13
0
 /// <summary>
 ///
 /// </summary>
 /// <param name="t0"></param>
 /// <param name="t1"></param>
 /// <returns></returns>
 public static Transform3d CreateRelative(ref Transform3d t0, ref Transform3d t1)
 {
     return(t1.Apply(t0.Inverse));
 }
示例#14
0
 /// <summary>
 /// Applies the inverse of this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public void ApplyInverse(ref Transform3d other)
 {
     Rotation.ApplyInverse(ref other.Rotation);
     other.Translation = ApplyInverse(other.Translation);
     other.Scale      /= Scale;
 }
示例#15
0
 /// <summary>
 /// Applies this transformation to the given transformation.
 /// </summary>
 /// <param name="other"></param>
 public void Apply(ref Transform3d other)
 {
     Rotation.Apply(ref other.Rotation);
     other.Translation = Apply(other.Translation);
     other.Scale      *= Scale;
 }