Fixed GetNearestPoint
This commit is contained in:
@@ -9,13 +9,27 @@ namespace FrameJosh.SplineImporter.Samples
|
||||
|
||||
[SerializeField] float cubeSize;
|
||||
|
||||
[SerializeField] float matrixSize;
|
||||
|
||||
void OnDrawGizmos()
|
||||
{
|
||||
if (!splinePlus) return;
|
||||
|
||||
splinePlus.GetNearestPoint(0, transform.position, out float3 position, out _, out _);
|
||||
splinePlus.GetNearestPoint(0, transform.position, out float3 position, out quaternion rotation, out _);
|
||||
|
||||
Gizmos.DrawCube(position, Vector3.one * cubeSize);
|
||||
|
||||
Gizmos.color = Color.green;
|
||||
|
||||
Gizmos.DrawRay(position, (Quaternion)rotation * Vector3.up * matrixSize);
|
||||
|
||||
Gizmos.color = Color.red;
|
||||
|
||||
Gizmos.DrawRay(position, (Quaternion)rotation * Vector3.right * matrixSize);
|
||||
|
||||
Gizmos.color = Color.blue;
|
||||
|
||||
Gizmos.DrawRay(position, (Quaternion)rotation * Vector3.forward * matrixSize);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user