コード例 #1
0
        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;
            }
        }
コード例 #2
0
        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));
        }
コード例 #3
0
 public void AlignUp(Vector3 axis)
 {
     Rotation = QuaternionEx.FromToRotation3D(Up, axis, Normal) * _rotation;
 }
コード例 #4
0
 public void AlignRight(Vector3 axis)
 {
     Rotation = QuaternionEx.FromToRotation3D(Right, axis, Up) * _rotation;
 }
コード例 #5
0
 public void AlignNormal(Vector3 axis)
 {
     Rotation = QuaternionEx.FromToRotation3D(Normal, axis, Right) * _rotation;
 }
コード例 #6
0
 public void AlignTip(Vector3 axis)
 {
     Rotation = QuaternionEx.FromToRotation3D(CentralAxis, axis, Look) * _rotation;
 }
コード例 #7
0
 public void AlignDepth(Vector3 axis)
 {
     Rotation = QuaternionEx.FromToRotation3D(Look, axis, Right) * _rotation;
 }
コード例 #8
0
 public void AlignHeight(Vector3 axis)
 {
     Rotation = QuaternionEx.FromToRotation3D(Up, axis, Right) * _rotation;
 }
コード例 #9
0
 public void PointTipAlongAxis(Vector3 axis)
 {
     Rotation = QuaternionEx.FromToRotation3D(CentralAxis, axis, Right) * _rotation;
 }