本文整理汇总了C#中IrrlichtNETCP.Vector3D.DotProduct方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3D.DotProduct方法的具体用法?C# Vector3D.DotProduct怎么用?C# Vector3D.DotProduct使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类IrrlichtNETCP.Vector3D
的用法示例。
在下文中一共展示了Vector3D.DotProduct方法的3个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: CalcTargetFromPosition
public static float CalcTargetFromPosition(ref Vector3D target, ref Vector3D position, ref Vector3D? front)
{
Vector3D f = new Vector3D(1, 0, 0);
if (front != null)
f = (Vector3D)front;
Vector3D tar = target - position;
tar.Z = 0;
if (tar.LengthSQ > 0)
tar.Normalize();
float dotAngle;
dotAngle = f.DotProduct(tar);
//Vector3D.Dot(ref front, ref tar, out dotAngle);
Vector3D cross;
cross = f.CrossProduct(tar);
//Vector3D.Cross(ref front, ref tar, out cross);
float angle = (float)Math.Acos(dotAngle);
if (cross.Z < 0)
angle = MathHelper.TwoPI - angle;
return angle;
}
示例2: RecalculateD
public void RecalculateD(Vector3D mpoint)
{
D = -mpoint.DotProduct(Normal);
}
示例3: RegisterLoginResponseHandler
private void RegisterLoginResponseHandler(bool loginSuccess, bool redirect, string message, string reason, LoginResponseData replyData)
{
Vector3D forward = new Vector3D(1, 0, 0);
Vector3D target = new Vector3D(replyData.LookAt.X, replyData.LookAt.Z, replyData.LookAt.Y);
float radHeading = forward.DotProduct(target);
Reference.Viewer.AvatarManager.RadHeading = radHeading * (float)Math.PI;
}