Posts: 2,188
Threads: 97
Joined: Jun 2017
07-20-2025, 02:31 PM
Curvy Splines will be available at a 70% discount on the 22nd of July.
Posts: 2
Threads: 0
Joined: Jul 2025
Considering buying this - one function I need is to be able to evaluate if the spline being drawn at runtime (when a user puts down two points) has any angles that exceed a set degree
For example, player puts down endpoint1, and then endpoint 2, then 3 ... I want to calculate if any angle exceeds 45 degrees and make it an invalid placement
Easily possible?
Posts: 2,188
Threads: 97
Joined: Jun 2017
Hi,
I will call the points 1, 2 and 3 as P1, P2, and P3.
P1P2 is the vector between P1 and P2.
Normally, any check needed to validate a placement should be done before the placement, and thus before updating the spline. This means that the check should not be done by the spline. I personally would implement it similarly to this:
bool canPlace = Vector3.Angle(P2P1, P2P3) < 45;
Regardless, yes you can use Curvy Spline's API to get the tangent (direction) of the spline at any point, thus you can calculate the angle between the tangent at P2 and another point (either P1, or any point in between them).
The method to use is
CurvySpline.GetTangent(...)
Did I answer your question?
Posts: 2
Threads: 0
Joined: Jul 2025
(07-23-2025, 09:25 AM)_Aka_ Wrote: Hi,
I will call the points 1, 2 and 3 as P1, P2, and P3.
P1P2 is the vector between P1 and P2.
Normally, any check needed to validate a placement should be done before the placement, and thus before updating the spline. This means that the check should not be done by the spline. I personally would implement it similarly to this:
bool canPlace = Vector3.Angle(P2P1, P2P3) < 45;
Regardless, yes you can use Curvy Spline's API to get the tangent (direction) of the spline at any point, thus you can calculate the angle between the tangent at P2 and another point (either P1, or any point in between them).
The method to use is CurvySpline.GetTangent(...)
Did I answer your question?
Thanks for that - I think so ... the reason I want the spline to exist, and be drawing, is I want it similar to a Satisfactory conveyor in the it draws, but turns the mesh red to indicate it is too sharp (also want ot be able to check collisions along the spline for the same reason)
Posts: 2,188
Threads: 97
Joined: Jun 2017
I understand, makes sense. Feel free to ask further questions.
Have a nice day.