示例#1
0
        /// <summary>
        /// Evaluates position and tangent on the spline using curve distance from the start. Valid length is [0..TotalLength].
        /// Caller must ensure that spline is valid before calling this method!
        /// </summary>
        public void EvalPositionTangentParametrized(float length, out PositionTangent positionTangent)
        {
            int   i;
            float t;

            GetSegmentIndexAndTime(_parametrization.GetApproximateTimeParameter(length), out i, out t);
            ItemData segment = _data[i];

            positionTangent.Position = segment.EvalPosition(t);
            positionTangent.Tangent  = segment.EvalTangent(t);
        }
示例#2
0
        /// <summary>
        /// Evaluates position and tangent on the spline. Valid time is [0..1],
        /// where 0 is spline first point, 1 - spline end point.
        /// Caller must ensure that spline is valid before calling this method!
        /// </summary>
        public void EvalPositionTangent(float time, out PositionTangent positionTangent)
        {
            int   i;
            float t;

            GetSegmentIndexAndTime(time, out i, out t);
            ItemData segment = _data[i];

            positionTangent.Position = segment.EvalPosition(t);
            positionTangent.Tangent  = segment.EvalTangent(t);
        }