Thread Rating:
  • 0 Vote(s) - 0 Average
  • 1
  • 2
  • 3
  • 4
  • 5
smooth connection of two splines.
#5
Hi,
Here is the relevant part of the code I send to Lukango

Code:
//Refresh splines to have the tangent information available and up to date
lastSpline.Refresh();
newSpline.Refresh();

var lastTangent = lastSpline.transform.TransformDirection(lastSpline.GetTangent(1));
var firstTangent = newSpline.transform.TransformDirection(newSpline.GetTangent(0));
//rotate the newSpline so that its first tangent aligns with lastSpline's last tangent
newSpline.transform.rotation = newSpline.transform.rotation * Quaternion.FromToRotation(firstTangent, lastTangent);

Is it clear to you?
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


Messages In This Thread
smooth connection of two splines. - by Lukango - 01-29-2019, 02:07 PM
RE: smooth connection of two splines. - by _Aka_ - 01-29-2019, 02:49 PM
RE: smooth connection of two splines. - by _Aka_ - 01-30-2019, 12:55 PM
RE: smooth connection of two splines. - by _Aka_ - 09-11-2019, 10:13 PM
RE: smooth connection of two splines. - by _Aka_ - 09-16-2019, 01:35 PM

Possibly Related Threads…
Thread Author Replies Views Last Post
  snap to the curve created by the curvy splines segment points ShiroeYamamoto 3 11 04-02-2024, 02:24 PM
Last Post: _Aka_
Bug Changing spline connection in inspector causes splines to revert to defaults lacota 3 6 03-18-2024, 07:55 PM
Last Post: _Aka_
Thumbs Up Can't delete connection lacota 3 6 03-16-2024, 11:34 AM
Last Post: _Aka_
  Using Unity's SplineContainer in Curvy Splines dlees9191 3 15 02-26-2024, 09:49 AM
Last Post: _Aka_

Forum Jump: