예제 #1
0
        public override SteeringOutput GetSteering()
        {
            // no KS? get it
            if (this.ownKS == null)
            {
                this.ownKS = GetComponent <KinematicState>();
            }

            return(Evade.GetSteering(this.ownKS, this.target, this.maxPredictionTime));
        }
예제 #2
0
        public override SteeringOutput GetSteering()
        {
            // no KS? get it
            if (this.ownKS == null)
            {
                this.ownKS = GetComponent <KinematicState>();
            }

            SteeringOutput result = Evade.GetSteering(this.ownKS, this.target, this.maxPredictionTime);

            base.applyRotationalPolicy(rotationalPolicy, result, target);
            return(result);
        }
예제 #3
0
        public static SteeringOutput GetSteering(KinematicState ownKS,
                                                 GameObject target, float maxPredictionTime = 3f,
                                                 bool showWhishker = true, float lookAheadLength = 10f, float avoidDistance = 10f, float secondaryWhiskerAngle = 30f, float secondaryWhiskerRatio = 0.7f)
        {
            // give priority to obstacle avoidance
            SteeringOutput so = ObstacleAvoidance.GetSteering(ownKS, showWhishker, lookAheadLength,
                                                              avoidDistance, secondaryWhiskerAngle, secondaryWhiskerRatio);

            if (so == null)
            {
                return(Evade.GetSteering(ownKS, target, maxPredictionTime));
            }

            return(so);
        }