//Evade: Flee a proyección futura protected Vector3 Evade(ISteerable who, float periodAhead) { var deltaPos = who.position - transform.position; var targetPosition = who.position + who.velocity * deltaPos.magnitude / who.maxVelocity; return(Flee(targetPosition)); }
//Pursuit: Seek a proyección futura public Vector3 Pursuit(ISteerable who, float periodAhead) { var deltaPos = who.position - transform.position; var targetPosition = who.position + who.velocity * deltaPos.magnitude / who.maxVelocity; return(Seek(targetPosition)); }
public IndoorsSteeringManager(ISteerable host, bool canOpenDoors, bool canBreakDoors) : base(host) { pathFinder = new PathFinder(WayPoint.WayPointList.FindAll(wp => wp.SpawnType == SpawnType.Path), true); pathFinder.GetNodePenalty = GetNodePenalty; this.canOpenDoors = canOpenDoors; this.canBreakDoors = canBreakDoors; character = (host as AIController).Character; findPathTimer = Rand.Range(0.0f, 1.0f); }
public static void SteerLeft(this ISteerable vehicle) { vehicle.wheel.SteerLeft(); }
public SteeringManager(ISteerable host) { this.host = host; wanderAngle = Rand.Range(0.0f, MathHelper.TwoPi); }
/// <summary> /// Called on start /// </summary> protected override void Start() { _target = this.As<ISteerable>(); }