Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
How to stop spline refreshing when a control point is deleted or removed?
#1
Hi, I using Curvy to make roads in my game.

Player can delete and move control points, but when this done the rest of the spline changes shape, so the spline does not match the road mesh.

I would like the spline not to change shape when control points are deleted or moved. How can I do this? I cannot find a way in the api to do this.

Thank you.
Reply
#2
Hi
Do you want the spline to not change at all, or do you want the change to be more localised? If it is the latter, try set the interpolation type of your spline to Bezier. Bezier, compared to Catmull-Rom or BSplines, have its Control Points modify a smaller part of the spline around it.
Did this help?
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply
#3
Thank you for message.

I want the spline to not change at all. 

(And I am using Bezier).
Reply
#4
I think I found how to do it, so I will write it here to help anybody else that needs it.

This is when using Bezier splines:

To stop neighboring spline segments from changing shape when you delete a segment, all you need to do is set AutoHandles = false for the control points next to the ones you remove. This keeps the original angle of the spline that comes from them.


Code:
cpBeforeSplit.AutoHandles = false;

cpAfterSplit.AutoHandles = false;

theSpline.Split(cpAfterSplit);
Reply
#5
Hi
Thanks for sharing the solution.
What you described is what I meant with "the change to be more localised". Now I understand exactly what you meant.
Sorry for not having answered a useful answer.
Have a nice day
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Possibly Related Threads…
Thread Author Replies Views Last Post
  Force spline normal to be always world up GameJazz 12 21 Yesterday, 01:20 PM
Last Post: _Aka_
  Gap between spline mesh segments Beaver_Boy 8 16 08-06-2022, 12:11 PM
Last Post: _Aka_
  How to get Split Length to match spline segment length? dromo 4 12 07-21-2022, 10:04 PM
Last Post: _Aka_
  Select Point in Scene soccertrash 1 6 07-04-2022, 04:03 PM
Last Post: _Aka_

Forum Jump: