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

◆ Normalize() [3/3]

static Vector4 Microsoft.Xna.Framework.Vector4.Normalize ( Vector4 vector)
inlinestatic

Definition at line 177 of file Vector4.cs.

178 {
179 float num = vector.X * vector.X + vector.Y * vector.Y + vector.Z * vector.Z + vector.W * vector.W;
180 float num2 = 1f / (float)Math.Sqrt(num);
181 Vector4 result = default(Vector4);
182 result.X = vector.X * num2;
183 result.Y = vector.Y * num2;
184 result.Z = vector.Z * num2;
185 result.W = vector.W * num2;
186 return result;
187 }
static double Sqrt(double d)
Vector4(float x, float y, float z, float w)
Definition Vector4.cs:49

References System.Math.Sqrt(), and Microsoft.Xna.Framework.Vector4.W.