Terraria v1.4.4.9
Terraria source code documentation
Loading...
Searching...
No Matches

◆ Normalize()

static Plane System.Numerics.Plane.Normalize ( Plane value)
inlinestatic

Definition at line 85 of file Plane.cs.

86 {
87 if (Vector.IsHardwareAccelerated)
88 {
89 float num = value.Normal.LengthSquared();
90 if (MathF.Abs(num - 1f) < 1.1920929E-07f)
91 {
92 return value;
93 }
94 float num2 = MathF.Sqrt(num);
95 return new Plane(value.Normal / num2, value.D / num2);
96 }
97 float num3 = value.Normal.X * value.Normal.X + value.Normal.Y * value.Normal.Y + value.Normal.Z * value.Normal.Z;
98 if (MathF.Abs(num3 - 1f) < 1.1920929E-07f)
99 {
100 return value;
101 }
102 float num4 = 1f / MathF.Sqrt(num3);
103 return new Plane(value.Normal.X * num4, value.Normal.Y * num4, value.Normal.Z * num4, value.D * num4);
104 }
Plane(float x, float y, float z, float d)
Definition Plane.cs:13

References System.Numerics.Plane.Plane(), System.MathF.Abs(), System.Numerics.Vector< T >.IsHardwareAccelerated, System.MathF.Sqrt(), and System.value.

Referenced by System.Numerics.Matrix4x4.CreateReflection(), and System.Numerics.Matrix4x4.CreateShadow().