修复头尾抖,auto orient完全胜利

Signed-off-by: TRAfoer <lhf190@outlook.com>
This commit is contained in:
2025-07-26 19:03:38 +08:00
parent b577cf7f8d
commit 428ca1d738
20 changed files with 120198 additions and 18641 deletions

View File

@@ -44,7 +44,7 @@ namespace Dreamteck.Splines
if (Camera.current != null)
{
_orthographic = Camera.current.orthographic;
}
}
else if (Camera.main != null)
{
_orthographic = Camera.main.orthographic;
@@ -124,10 +124,12 @@ namespace Dreamteck.Splines
for (int i = 0; i < sampleCount; i++)
{
GetSample(i, ref evalResult);
// if (i == 0) evalResult.position = transform.position;
// else if (i == sampleCount - 1) evalResult.position = transform.position; // 或目标点
Vector3 center = evalResult.position;
if (hasOffset) center += offset.x * -Vector3.Cross(evalResult.forward, evalResult.up) + offset.y * evalResult.up + offset.z * evalResult.forward;
Vector3 vertexNormal;
if(orthoGraphic) vertexNormal = vertexDirection;
if (orthoGraphic) vertexNormal = vertexDirection;
else vertexNormal = (vertexDirection - center).normalized;
Vector3 vertexRight = Vector3.Cross(evalResult.forward, vertexNormal).normalized;
if (uvMode == UVMode.UniformClamp || uvMode == UVMode.UniformClip) AddUVDistance(i);