本文整理汇总了C#中Vec3.LengthFast方法的典型用法代码示例。如果您正苦于以下问题:C# Vec3.LengthFast方法的具体用法?C# Vec3.LengthFast怎么用?C# Vec3.LengthFast使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Vec3
的用法示例。
在下文中一共展示了Vec3.LengthFast方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的C#代码示例。
示例1: IsBlinded
// we'll want to rip this out and throw it in a class for statue.. here for testing
// check if _we're_ frozen and blinded
// check if local PChar instance is frozen, instead of peers, to cut redundant checks and networking
protected Boolean IsBlinded()
{
foreach (Entity o in Entities.Instance.EntitiesCollection)
{
PlayerCharacter pc = o as PlayerCharacter;
if (pc == null || ReferenceEquals(this,pc)) continue;
Vec3 delta = new Vec3(Position - pc.Position);
// if valid angle, throw out ray (bearing in mind hit location is anywhere on mesh)
Radian angle = MathUtils.GetVectorsAngle(delta, pc.Rotation.GetForward());
if (Math.Abs(angle) < MathFunctions.DegToRad(15))
{
float hit = PhysicsWorld.Instance.RayCast(new Ray(Position,delta), (int)ContactGroup.CastAll).Distance;
return delta.LengthFast() < 10 && hit <= delta.LengthFast(); //Math.Abs(hit - delta.Length()) < 20f;
}
}
return false;
//float dist = PhysicsWorld.Instance.RayCast(new Ray(Position,Rotation.GetForward()), (int)ContactGroup.CastAll).Distance;
//return dist > 1 && dist < 10;
}