Optimize vectors normalization

This commit is contained in:
Wojtek Figat
2023-04-17 11:10:14 +02:00
parent c3cc78b7c2
commit b85184eee0
13 changed files with 80 additions and 72 deletions

View File

@@ -304,7 +304,7 @@ namespace FlaxEngine
public void Normalize()
{
float length = Length;
if (!Mathf.IsZero(length))
if (length >= Mathf.Epsilon)
{
float inverse = 1.0f / length;
X *= inverse;