Exemple #1
0
        public static SteeringOutput GetSteering(KinematicState ownKS, float wanderRate = 30f, float targetAngularRadius       = 2f,
                                                 float slowDownAngularRadius            = 10f, float timeToDesiredAngularSpeed = 0.1f)
        {
            // align with a surrogate target that has your new orientation and go there

            // slightly change the orientation
            float desiredOrientation = ownKS.orientation + wanderRate * Utils.binomial();

            // give that orientation to the surrogate target
            SURROGATE_TARGET.transform.rotation = Quaternion.Euler(0, 0, desiredOrientation);

            // align with the surrogate target
            SteeringOutput al = Align.GetSteering(ownKS, SURROGATE_TARGET, targetAngularRadius, slowDownAngularRadius, timeToDesiredAngularSpeed);

            // go where you look (looked, actually)
            SteeringOutput gwyl = GoWhereYouLook.GetSteering(ownKS);             // should never return null

            // combine, if possible
            if (al != null)
            {
                gwyl.angularActive       = true;
                gwyl.angularAcceleration = al.angularAcceleration;
            }

            return(gwyl);
        }
        public static SteeringOutput GetSteering(KinematicState ownKS, float wanderRate = 10f)
        {
            // "slightly" change your own orientation
            ownKS.orientation += Utils.binomial() * wanderRate;

            // and go where you look
            return(GoWhereYouLook.GetSteering(ownKS));
        }
Exemple #3
0
        protected override SteeringOutput GetSteering()
        {
            SteeringOutput result = GoWhereYouLook.GetSteering(m_ownKS);

            base.ApplyFacingPolicy(EFacingPolicy.LWYGI, result);

            return(result);
        }
Exemple #4
0
        public static SteeringOutput GetSteering(KinematicState ownKS)
        {
            SteeringOutput result = new SteeringOutput();

            result.angularAcceleration = ownKS.maxAngularAcceleration;
            SteeringOutput r2 = GoWhereYouLook.GetSteering(ownKS);

            result.linearAcceleration = r2.linearAcceleration;

            return(result);
        }
Exemple #5
0
 public override SteeringOutput GetSteering()
 {
     // no rotational policy applied here. It makes no sense.
     return(GoWhereYouLook.GetSteering(this.ownKS));
 }
 public override SteeringOutput GetSteering()
 {
     return(GoWhereYouLook.GetSteering(this.ownKS));
 }
Exemple #7
0
        public static SteeringOutput GetSteering(KinematicState ownKS, SNaiveWander info)
        {
            ownKS.m_orientation += info.m_wanderRate * MathExtent.Binomial();

            return(GoWhereYouLook.GetSteering(ownKS));
        }