Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
Corner Angle Revisited
#4
Hi Samy,

I would be surprised if the issue is due to outdate cache, but I stay open to this possibility. The problem not being easily reproducible makes it difficult to debug, but let's try something: Before using a spline in your code, force it to refresh by calling spine.Refresh().

In the lack of a reproduction case, what I suspect is a potential lack of precision in the data used to compute the tangent.
You use GetTangentByDistance. This one compares to neighboring point's position to deduce the tangent. Neighboring in this context is 0.01 tf difference. For a very long spline, 0.01 tf can be a significant distance.
If this is the issue, then I seen two solutions (and at the same time ways to confirm or not that this is the issue):
1- Use GetTangentByDistanceFast: this one used the spline's cache. You can control the caches's density in the spline's settings.
2- Modify GetTangentByDistance's code to make the delta a value other than 0.01 tf.

I hope this helped.
Have a great

PS:
Looking at your code, I see something that bothers me:
delta *= Time.deltaTime;
lastcornerangle += delta;
I don't know where lastcornerangle and delta are used later on, so maybe this code is doing what it shoudl be, but the multipication with deltaTime seems weird to me.
Please consider leaving a review for Curvy. This will help a lot keeping Curvy relevant in the eyes of the Asset Store algorithm.
Reply


Messages In This Thread
Corner Angle Revisited - by SAMYTHEBIGJUICY - 12-21-2023, 04:54 AM
RE: Corner Angle Revisited - by SAMYTHEBIGJUICY - 12-21-2023, 12:21 PM
RE: Corner Angle Revisited - by SAMYTHEBIGJUICY - 12-22-2023, 05:40 PM
RE: Corner Angle Revisited - by _Aka_ - 12-23-2023, 01:39 PM
RE: Corner Angle Revisited - by SAMYTHEBIGJUICY - 12-27-2023, 09:59 PM
RE: Corner Angle Revisited - by SAMYTHEBIGJUICY - 12-28-2023, 12:10 PM
RE: Corner Angle Revisited - by _Aka_ - 12-29-2023, 10:26 PM
RE: Corner Angle Revisited - by SAMYTHEBIGJUICY - 01-01-2024, 04:01 PM
RE: Corner Angle Revisited - by SAMYTHEBIGJUICY - 12-28-2023, 10:59 PM
RE: Corner Angle Revisited - by _Aka_ - 12-29-2023, 08:22 PM
RE: Corner Angle Revisited - by _Aka_ - 01-02-2024, 10:12 AM

Possibly Related Threads…
Thread Author Replies Views Last Post
  How can I find the point on the spline after applying with offset angle+radius? Chanon 1 5 10-01-2022, 11:50 AM
Last Post: _Aka_
  Make hard angle cll3m 5 1,402 07-01-2021, 04:06 PM
Last Post: _Aka_
Wink How to generate right angle road oscar.ken 6 4,687 04-30-2020, 05:38 PM
Last Post: ThomasTheTank
  Twisted mesh at corner on linear path JLeonard 0 2,176 02-24-2017, 04:42 PM
Last Post: JLeonard

Forum Jump: