/// <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); }
/// <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)); }
/// <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)); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <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); }
/// <summary> /// /// </summary> /// <param name="scale"></param> /// <param name="orientation"></param> public Transform3d(Vec3d scale, Orient3d orientation) { Scale = scale; Rotation = orientation.Rotation; Translation = orientation.Translation; }