Example #1
0
    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
                   ));
    }
Example #2
0
    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
                   ));
    }