本文整理汇总了C#中Vector3d.ApproxEquals方法的典型用法代码示例。如果您正苦于以下问题:C# Vector3d.ApproxEquals方法的具体用法?C# Vector3d.ApproxEquals怎么用?C# Vector3d.ApproxEquals使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vector3d
的用法示例。
在下文中一共展示了Vector3d.ApproxEquals方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: UpdatePosition
/// <summary>
/// Tell Vivox where we are standing
/// </summary>
/// <remarks>This has to be called when we move or turn.</remarks>
internal void UpdatePosition(AgentManager self)
{
// Get position in Global coordinates
Vector3d OMVpos = new Vector3d(self.GlobalPosition);
// Do not send trivial updates.
if (OMVpos.ApproxEquals(oldPosition, 1.0))
return;
oldPosition = OMVpos;
// Convert to the coordinate space that Vivox uses
// OMV X is East, Y is North, Z is up
// VVX X is East, Y is up, Z is South
position.Position = new Vector3d(OMVpos.X, OMVpos.Z, -OMVpos.Y);
// TODO Rotate these two vectors
// Get azimuth from the facing Quaternion.
// By definition, facing.W = Cos( angle/2 )
double angle = 2.0 * Math.Acos(self.Movement.BodyRotation.W);
position.LeftOrientation = new Vector3d(-1.0, 0.0, 0.0);
position.AtOrientation = new Vector3d((float)Math.Acos(angle), 0.0, -(float)Math.Asin(angle));
SessionSet3DPosition(
sessionHandle,
position,
position);
}