BezierCurves.BezierCurve3D.GetRotationOnCubicCurve C# (CSharp) Method

GetRotationOnCubicCurve() public static method

public static GetRotationOnCubicCurve ( float time, Vector3 up, Vector3 startPosition, Vector3 endPosition, Vector3 startTangent, Vector3 endTangent ) : Quaternion
time float
up UnityEngine.Vector3
startPosition UnityEngine.Vector3
endPosition UnityEngine.Vector3
startTangent UnityEngine.Vector3
endTangent UnityEngine.Vector3
return UnityEngine.Quaternion
        public static Quaternion GetRotationOnCubicCurve(float time, Vector3 up, Vector3 startPosition, Vector3 endPosition, Vector3 startTangent, Vector3 endTangent)
        {
            Vector3 tangent = GetTangentOnCubicCurve(time, startPosition, endPosition, startTangent, endTangent);
            Vector3 normal = GetNormalOnCubicCurve(time, up, startPosition, endPosition, startTangent, endTangent);

            return Quaternion.LookRotation(tangent, normal);
        }

Same methods

BezierCurve3D::GetRotationOnCubicCurve ( float time, Vector3 up, BezierPoint3D startPoint, BezierPoint3D endPoint ) : Quaternion

Usage Example

Example #1
0
        public Quaternion GetRotation(float time, Vector3 up)
        {
            BezierPoint3D startPoint;
            BezierPoint3D endPoint;
            float         timeRelativeToSegment;

            this.GetCubicSegment(time, out startPoint, out endPoint, out timeRelativeToSegment);

            return(BezierCurve3D.GetRotationOnCubicCurve(timeRelativeToSegment, up, startPoint, endPoint));
        }