本文整理汇总了C#中Vector4d.NormalizeFast方法的典型用法代码示例。如果您正苦于以下问题:C# Vector4d.NormalizeFast方法的具体用法?C# Vector4d.NormalizeFast怎么用?C# Vector4d.NormalizeFast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector4d
的用法示例。
在下文中一共展示了Vector4d.NormalizeFast方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdateFrustum
/// <summary>Update the ModelView and Frustum. Done on every update cycle and before the world is initially loaded so we can preload chunks in the initial frustum.</summary>
private static void UpdateFrustum()
{
ModelView = Matrix4d.LookAt(Player.Coords.Xf, Player.Coords.Yf + Constants.PLAYER_EYE_LEVEL, Player.Coords.Zf, Player.Coords.Xf + (float)Math.Cos(Player.Coords.Direction) * (float)Math.Cos(Player.Coords.Pitch), Player.Coords.Yf + Constants.PLAYER_EYE_LEVEL + (float)Math.Sin(Player.Coords.Pitch), Player.Coords.Zf + (float)Math.Sin(Player.Coords.Direction) * (float)Math.Cos(Player.Coords.Pitch), 0, 1, 0);
Matrix4d clip;
Matrix4d.Mult(ref ModelView, ref Projection, out clip);
LeftFrustum = new Vector4d(clip.M14 + clip.M11, clip.M24 + clip.M21, clip.M34 + clip.M31, clip.M44 + clip.M41);
LeftFrustum.NormalizeFast();
RightFrustum = new Vector4d(clip.M14 - clip.M11, clip.M24 - clip.M21, clip.M34 - clip.M31, clip.M44 - clip.M41);
RightFrustum.NormalizeFast();
BottomFrustum = new Vector4d(clip.M14 + clip.M12, clip.M24 + clip.M22, clip.M34 + clip.M32, clip.M44 + clip.M42);
BottomFrustum.NormalizeFast();
TopFrustum = new Vector4d(clip.M14 - clip.M12, clip.M24 - clip.M22, clip.M34 - clip.M32, clip.M44 - clip.M42);
TopFrustum.NormalizeFast();
NearFrustum = new Vector4d(clip.M14 + clip.M13, clip.M24 + clip.M23, clip.M34 + clip.M33, clip.M44 + clip.M43);
NearFrustum.NormalizeFast();
FarFrustum = new Vector4d(clip.M14 - clip.M13, clip.M24 - clip.M23, clip.M34 - clip.M33, clip.M44 - clip.M43);
FarFrustum.NormalizeFast();
}