protected bool InfoCanSee(Vector3 location) { Vector3 thisVantagePoint = GetVantagePoint(); Vector3 otherVantagePoint = location + new Vector3(0, 0.1f, 0); float distance = Vector3.Distance(thisVantagePoint, otherVantagePoint); if (distance > sightDistance) { return(false); } return(direction.WithinRangeOfVision(otherVantagePoint, visionWideness) && EnvironmentPhysics.LineOfSightToVantagePointExists( visionSharpness, thisVantagePoint, otherVantagePoint )); }
public bool InfoCanSee(HumanoidModel other) { Vector3 thisVantagePoint = GetVantagePoint(); Vector3 otherVantagePoint = other.GetVantagePoint(); float distance = Vector3.Distance(thisVantagePoint, otherVantagePoint); if (distance > sightDistance) { return(false); } return(direction.WithinRangeOfVision(otherVantagePoint, visionWideness) && EnvironmentPhysics.LineOfSightToVantagePointExists( visionSharpness, thisVantagePoint, otherVantagePoint )); }