/// <summary> /// Project a world space point onto the spline and write to a SplineSample. /// </summary> /// <param name="point">3D Point in world space</param> /// <param name="result">The SplineSample object to write the result into</param> /// <param name="from">Sample from [0-1] default: 0.0</param> /// <param name="to">Sample to [0-1] default: 1.0</param> /// <returns></returns> public virtual void Project(Vector3 point, SplineSample result, double from = 0.0, double to = 1.0, SplinePath.EvaluateMode mode = SplinePath.EvaluateMode.Cached) { path.Project(point, result, from, to, mode); }
/// <summary> /// Returns the percent from the spline at a given distance from the start point /// </summary> /// <param name="start">The start point</param> /// <param name="distance">The distance to travel</param> /// <param name="direction">The direction towards which to move</param> /// <param name="traveled">Returns the distance actually traveled. Usually equal to distance but could be less if the travel distance exceeds the remaining spline length.</param> /// <param name="mode">If set to EvaluateMode.Accurate, the actual spline will be evaluated instead of the cached samples.</param> /// <returns></returns> public double Travel(double start, float distance, Spline.Direction direction, out float traveled, SplinePath.EvaluateMode mode = SplinePath.EvaluateMode.Cached) { return(path.Travel(start, distance, direction, out traveled, mode)); }
/// <summary> /// Evaluate the generated path of the segment and return only the position. This is the path after the segment is extruded. /// </summary> /// <param name="percent">Percent along the segment path [0-1]</param> /// <param name="mode">If set to EvaluateMode.Accurate, the actual spline will be evaluated instead of the cached samples.</param> /// <returns></returns> public Vector3 EvaluatePosition(double percent, SplinePath.EvaluateMode mode = SplinePath.EvaluateMode.Cached) { return(path.EvaluatePosition(percent, mode)); }
/// <summary> /// Calculates the length of the generated path in world units. /// </summary> /// <param name="from">The start of the segment to calculate the length of</param> /// <param name="to">The end of the segment</param> /// <returns></returns> public virtual float CalculateLength(double from = 0.0, double to = 1.0, SplinePath.EvaluateMode mode = SplinePath.EvaluateMode.Cached) { return(path.CalculateLength(from, to, mode)); }
/// <summary> /// Evaluate the generated path of the segment. This is the path after the segment is extruded. /// </summary> /// <param name="percent">Percent along the segment path [0-1]</param> /// <param name="result">The SplineSample object to write the result into</param> /// <param name="mode">If set to EvaluateMode.Accurate, the actual spline will be evaluated instead of the cached samples.</param> public void Evaluate(double percent, SplineSample result, SplinePath.EvaluateMode mode = SplinePath.EvaluateMode.Cached) { path.Evaluate(percent, result, mode); }