コード例 #1
0
 public WallAvoidance(SteeringBehaviorsManager manager, Vehicle owner, float setFeelersLength, List <Wall> setWalls)
     : base(manager, owner)
 {
     feelers       = new List <Vector2>(3);
     feelersLength = setFeelersLength;
     walls         = setWalls;
 }
コード例 #2
0
 public Wander(SteeringBehaviorsManager manager, Vehicle theOwner, float setWandJitter, float setWandRadius, float setWandDist)
     : base(manager, theOwner)
 {
     wanderJitter   = setWandJitter;
     wanderRadius   = setWandRadius;
     wanderDistance = setWandDist;
     wanderTarget   = RandomHelper.getRandomVector() * wanderRadius;
 }
コード例 #3
0
        public EvadeMulti(SteeringBehaviorsManager manager, Vehicle setOwner, float setMinDistance, GetVehicles updatePursuers, bool avoidBullets)
            : base(manager, setOwner)
        {
            minDistance       = setMinDistance;
            minDistanceSquare = minDistance * minDistance;

            this.avoidBullets = avoidBullets;

            //evade = new Evade(manager, setOwner, null, setMinDistance);

            UpdatePursuers = updatePursuers;

            flee = new Flee(manager, setOwner, new Vector2());
        }
コード例 #4
0
 public Arrive(SteeringBehaviorsManager manager, Vehicle theOwner, Vector2 targetPos, Deceleration decel)
     : base(manager, theOwner)
 {
     targetPosition = targetPos; deceleration = decel;
 }
コード例 #5
0
 public Flee(SteeringBehaviorsManager manager, Vehicle theOwner, Vector2 targetPos) : base(manager, theOwner)
 {
     targetPosition = targetPos;
 }
コード例 #6
0
 public SteeringBehavior(SteeringBehaviorsManager manager, Vehicle theOwner)
 {
     owner = theOwner; steeringBehaviorsManager = manager;
 }
コード例 #7
0
 public Vehicle(Vector2 setPosition, Vector2 setVelocity, float setMass, float setMaxSpeed, float setMaxForce, float setMaxTurnRate, GetVehicles getVehiclesFunction, int width, int height)
     : base(setPosition, setVelocity, setMass, setMaxSpeed, setMaxForce, setMaxTurnRate)
 {
     steering = new SteeringBehaviorsManager(this, getVehiclesFunction, width, height);
 }
コード例 #8
0
 public override void Update(GameTime gameTime)
 {
     neighbors = SteeringBehaviorsManager.GetNeighbors(Owner);
 }
コード例 #9
0
 public Seek(SteeringBehaviorsManager manager, Vehicle theOwner, Vector2 targetPos)
     : base(manager, theOwner)
 {
     targetPosition = targetPos;
 }
コード例 #10
0
 public Pursuit(SteeringBehaviorsManager manager, Vehicle theOwner, Vehicle theEvader)
     : base(manager,theOwner)
 {
     evader = theEvader; seek = new Seek(manager, theOwner, new Vector2());
 }
コード例 #11
0
 public EvadeMulti(SteeringBehaviorsManager manager, Vehicle setOwner, float setMinDistance, GetVehicles updatePursuers)
     : this(manager, setOwner, setMinDistance, updatePursuers, false)
 {
 }
コード例 #12
0
        public EvadeMulti(SteeringBehaviorsManager manager, Vehicle setOwner, float setMinDistance, GetVehicles updatePursuers, bool avoidBullets)
            : base(manager, setOwner)
        {
            minDistance = setMinDistance;
            minDistanceSquare = minDistance * minDistance;

            this.avoidBullets = avoidBullets;

            //evade = new Evade(manager, setOwner, null, setMinDistance);

            UpdatePursuers = updatePursuers;

            flee = new Flee(manager, setOwner, new Vector2());
        }
コード例 #13
0
 public Evade(SteeringBehaviorsManager manager, Vehicle theOwner, Vehicle thePursuer, float setMinDistance)
     : base(manager,theOwner)
 {
     pursuer = thePursuer; flee = new Flee(manager, theOwner, new Vector2()); minDistance = setMinDistance; minDistanceSquare = minDistance * minDistance;
 }
コード例 #14
0
 public Arrive(SteeringBehaviorsManager manager, Vehicle theOwner, Vector2 targetPos, Deceleration decel)
     : base(manager,theOwner)
 {
     targetPosition = targetPos; deceleration = decel;
 }
コード例 #15
0
 public Pursuit(SteeringBehaviorsManager manager, Vehicle theOwner, Vehicle theEvader)
     : base(manager, theOwner)
 {
     evader = theEvader; seek = new Seek(manager, theOwner, new Vector2());
 }
コード例 #16
0
 public Evade(SteeringBehaviorsManager manager, Vehicle theOwner, Vehicle thePursuer, float setMinDistance)
     : base(manager, theOwner)
 {
     pursuer = thePursuer; flee = new Flee(manager, theOwner, new Vector2()); minDistance = setMinDistance; minDistanceSquare = minDistance * minDistance;
 }
コード例 #17
0
 public Separation(SteeringBehaviorsManager manager, Vehicle theOwner)
     : base(manager,theOwner)
 {
 }
コード例 #18
0
 public EvadeMulti(SteeringBehaviorsManager manager, Vehicle setOwner, float setMinDistance, GetVehicles updatePursuers)
     : this(manager, setOwner, setMinDistance, updatePursuers, false)
 {
 }
コード例 #19
0
 public SteeringBehavior(SteeringBehaviorsManager manager, Vehicle theOwner)
 {
     owner = theOwner; steeringBehaviorsManager = manager;
 }
コード例 #20
0
 public Separation(SteeringBehaviorsManager manager, Vehicle theOwner) : base(manager, theOwner)
 {
 }
コード例 #21
0
 public WallAvoidance(SteeringBehaviorsManager manager, Vehicle owner, float setFeelersLength, List<Wall> setWalls)
     : base(manager, owner)
 {
     feelers = new List<Vector2>(3);
     feelersLength = setFeelersLength;
     walls = setWalls;
 }
コード例 #22
0
 public Vehicle(Vector2 setPosition, Vector2 setVelocity, float setMass, float setMaxSpeed, float setMaxForce, float setMaxTurnRate, GetVehicles getVehiclesFunction, int width, int height)
     : base(setPosition, setVelocity, setMass, setMaxSpeed, setMaxForce, setMaxTurnRate)
 {
     steering = new SteeringBehaviorsManager(this, getVehiclesFunction, width, height);
 }
コード例 #23
0
 public Wander(SteeringBehaviorsManager manager, Vehicle theOwner, float setWandJitter, float setWandRadius, float setWandDist)
     : base(manager,theOwner)
 {
     wanderJitter = setWandJitter;
     wanderRadius = setWandRadius;
     wanderDistance = setWandDist;
     wanderTarget = RandomHelper.getRandomVector() * wanderRadius;
 }