public static void NormalizeFast(ref SCNVector3 vec, out SCNVector3 result) { pfloat scale = (pfloat)MathHelper.InverseSqrtFast(vec.X * vec.X + vec.Y * vec.Y + vec.Z * vec.Z); result.X = vec.X * scale; result.Y = vec.Y * scale; result.Z = vec.Z * scale; }
public void NormalizeFast() { pfloat scale = (pfloat)MathHelper.InverseSqrtFast(X * X + Y * Y + Z * Z); X *= scale; Y *= scale; Z *= scale; }
public static SCNVector3 NormalizeFast(SCNVector3 vec) { pfloat scale = (pfloat)MathHelper.InverseSqrtFast(vec.X * vec.X + vec.Y * vec.Y + vec.Z * vec.Z); vec.X *= scale; vec.Y *= scale; vec.Z *= scale; return(vec); }