Skip to content

Commit b737b75

Browse files
author
Sir Victor
committed
Release v2.2.4
1 parent f0df6ad commit b737b75

File tree

75 files changed

+11
-4
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

75 files changed

+11
-4
lines changed

Runtime/BezierSpline.cs

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -754,7 +754,14 @@ public void GetEvenlySpacedPoints(float spacing, SplinePath bezierPath, float pr
754754
parametersT.Add(0f);
755755

756756
var lastRotationAxis = (FlipNormals ? -1 : 1) * Vector3.forward;
757-
var normalVector = Vector3.Cross(lastRotationAxis, tangents[0]).normalized;
757+
758+
var normalVector = Vector3.Cross(lastRotationAxis, tangents[0]).normalized;
759+
760+
if (normalVector == Vector3.zero) {
761+
lastRotationAxis = (FlipNormals ? -1 : 1) * Vector3.left;
762+
normalVector = Vector3.Cross(lastRotationAxis, tangents[0]).normalized;
763+
}
764+
758765
var rotatedNormalVector = GetRotatedNormal(normalVector, 0f);
759766
normals.Add(rotatedNormalVector);
760767
for (var i = 1; i < segmentsCount || t < 1; i++)
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.

0 commit comments

Comments
 (0)