本文整理汇总了C#中WoWPoint.GetDirectionTo方法的典型用法代码示例。如果您正苦于以下问题:C# WoWPoint.GetDirectionTo方法的具体用法?C# WoWPoint.GetDirectionTo怎么用?C# WoWPoint.GetDirectionTo使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类WoWPoint
的用法示例。
在下文中一共展示了WoWPoint.GetDirectionTo方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: FacingTowardsUnitRadians
/// <summary>Returns the angle we are facing towards given our point to the targets point (taking a stab at this description)</summary>
/// <param name="me">the player</param>
/// <param name="target">the target</param>
/// <returns>The facing towards unit radians.</returns>
private static float FacingTowardsUnitRadians(WoWPoint me, WoWPoint target)
{
try
{
WoWPoint direction = me.GetDirectionTo(target);
direction.Normalize();
float myFacing = StyxWoW.Me.Rotation;
// real and safe tan reverse function
double ret = Math.Atan2(direction.Y, direction.X);
double alpha = Math.Abs(myFacing - ret);
if (alpha > Math.PI)
{
alpha = Math.Abs(2 * Math.PI - alpha);
}
if (Double.IsNaN(alpha)) return 0f;
return (float)alpha;
}
catch
{
return 0f;
}
}