public void AlignAxis3D(int axisIndex, AxisSign axisSign, Vector3 axis) { if (CanChange3D) { Vector3 axisToAlign = GetAxis3D(axisIndex, axisSign); Vector3 perpAxis = GetAxis3D((axisIndex + 1) % 3, axisSign); Quaternion alignRotation = QuaternionEx.FromToRotation3D(axisToAlign, axis, perpAxis); Rotation3D = alignRotation * _rotation3D; } }
public void SetMappedAxis(Vector3 axis) { if (!IsMapped) { return; } Vector3 perp180 = _transform.GetAxis3D(0, AxisSign.Positive); if (_mappedAxisDesc.Index == 0) { perp180 = _transform.GetAxis3D(1, AxisSign.Positive); } _transform.Rotate3D(QuaternionEx.FromToRotation3D(Axis, axis, perp180)); }
public void AlignUp(Vector3 axis) { Rotation = QuaternionEx.FromToRotation3D(Up, axis, Normal) * _rotation; }
public void AlignRight(Vector3 axis) { Rotation = QuaternionEx.FromToRotation3D(Right, axis, Up) * _rotation; }
public void AlignNormal(Vector3 axis) { Rotation = QuaternionEx.FromToRotation3D(Normal, axis, Right) * _rotation; }
public void AlignTip(Vector3 axis) { Rotation = QuaternionEx.FromToRotation3D(CentralAxis, axis, Look) * _rotation; }
public void AlignDepth(Vector3 axis) { Rotation = QuaternionEx.FromToRotation3D(Look, axis, Right) * _rotation; }
public void AlignHeight(Vector3 axis) { Rotation = QuaternionEx.FromToRotation3D(Up, axis, Right) * _rotation; }
public void PointTipAlongAxis(Vector3 axis) { Rotation = QuaternionEx.FromToRotation3D(CentralAxis, axis, Right) * _rotation; }