Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Calculate corner strength
#1
Hi, I'm using a spline for a racing track and I have the player car follow the spline and steering moves the cars offset from the spline. 

If the player does not steer when going around a corner I'd like the car to drive straight on instead of following the spline. I figured if I could calculate the corner angle for each point on the spline I could use that to apply oppose offset to simulate the car driving straight. 

Is there a way I could calculate the corner angles? Thanks
Reply
#2
Hi,
Use the CurvySpline.GetTangent between two close points, and calculate the angle between them.
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


Possibly Related Threads…
Thread Author Replies Views Last Post
Bug Corner Angle Revisited SAMYTHEBIGJUICY 10 15 01-02-2024, 10:12 AM
Last Post: _Aka_
  How to calculate curvature of spline jh092 3 2,064 08-01-2020, 04:51 PM
Last Post: _Aka_
  Calculate total time for spline to complete GenericJoe 1 3,154 05-29-2018, 01:23 PM
Last Post: _Aka_
Big Grin Calculate distance between control points. _nico 3 6,178 10-08-2017, 02:05 PM
Last Post: PerryLif

Forum Jump: