Пример #1
0
        public BezierPointInfo GetPointInfo(float t)
        {
            BezierPointInfo pInfo = new BezierPointInfo();
            float v = map(t);
            pInfo.point = bezierPoint( v );

            Vector3 tangent = (this.point (v + 0.001f) - this.point (v)).normalized;
            pInfo.tangent = tangent;

            Quaternion q = Quaternion.Lerp(startRot, endRot, v);
            Vector3 up = Vector3.Cross (tangent, q * Vector3.right);
            pInfo.rotation = Quaternion.LookRotation(tangent, up);

            return pInfo;
        }
Пример #2
0
        public BezierPointInfo GetPointInfo(float t)
        {
            BezierPointInfo pInfo = new BezierPointInfo();
            float           v     = map(t);

            pInfo.point = bezierPoint(v);

            Vector3 tangent = (this.point(v + 0.001f) - this.point(v)).normalized;

            pInfo.tangent = tangent;

            Quaternion q  = Quaternion.Lerp(startRot, endRot, v);
            Vector3    up = Vector3.Cross(tangent, q * Vector3.right);

            pInfo.rotation = Quaternion.LookRotation(tangent, up);

            return(pInfo);
        }