Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calculate distance between control points.
#3
Each CP have a Length property as well as a Distance one. The latter tells the Distance from the start of spline.
So if you want to split a segment in half do something like:

Code:
var pos=spline.InterpolateByDistance(cp.Distance+cp.Length/2);
var newCP=spline.InsertAfter(cp);
newCP.position=pos;
Reply


Messages In This Thread
RE: Calculate distance between control points. - by Jake - 08-16-2017, 06:51 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  Control Point Interpolation Overrides. rickgplus 1 797 12-11-2025, 08:52 AM
Last Post: _Aka_
  OnAfterControlPointAdded - Control Point is null jh092 5 3,669 02-04-2025, 09:31 PM
Last Post: _Aka_
  How to generate gameobject on the control point Yang Yi 1 1,849 12-10-2024, 10:14 PM
Last Post: _Aka_
  Calculate corner strength derkoi 1 1,682 08-31-2024, 08:22 AM
Last Post: _Aka_

Forum Jump: