C# Class SimpleSoccer.Net.SteeringBehaviors

Afficher le fichier Open project: soshimozi/SimpleSoccer.Net Class Usage Examples

Protected Properties

Свойство Type Description
_behaviorFlags int
_dribbleFeelers List
_separationMultiple double

Méthodes publiques

Méthode Description
CalculateSteeringForce ( ) : Vector2D

Calculates the overall steering force based on the currently active steering behaviors.

RenderAids ( Graphics g ) : void

Render force lines

SteeringBehaviors ( PlayerBase player, SoccerBall ball ) : System

Méthodes protégées

Méthode Description
accumulateForce ( Vector2D &steeringForce, Vector2D additionalForce ) : bool

This function calculates how much of its max steering force the vehicle has left to apply and then applies that amount of the force to add.

calculateArriveVector ( Vector2D target, DecelerationState decel ) : Vector2D

This behavior is similar to seek but it attempts to arrive at the target with a zero velocity

calculateInterposeVector ( SoccerBall ball, Vector2D target, double distFromTarget ) : Vector2D

Given an opponent and an object position this method returns a force that attempts to position the agent between them

calculatePursuitVector ( SoccerBall ball ) : Vector2D

This behavior creates a force that steers the agent towards the ball

calculateSeekVector ( Vector2D target ) : Vector2D

Given a target, this behavior returns a steering force which will allign the agent with the target and move the agent in the desired direction

calculateSeparationVector ( ) : Vector2D

This calculates a force repelling from the other neighbors

findNeighbours ( ) : void

Tags any vehicles within a predefined radius

sumForces ( ) : Vector2D

This method calls each active steering behavior and acumulates their forces until the max steering force magnitude is reached at which time the function returns the steering force accumulated to that point

Method Details

CalculateSteeringForce() public méthode

Calculates the overall steering force based on the currently active steering behaviors.
public CalculateSteeringForce ( ) : Vector2D
Résultat Vector2D

RenderAids() public méthode

Render force lines
public RenderAids ( Graphics g ) : void
g System.Drawing.Graphics
Résultat void

SteeringBehaviors() public méthode

public SteeringBehaviors ( PlayerBase player, SoccerBall ball ) : System
player PlayerBase
ball SoccerBall
Résultat System

accumulateForce() protected méthode

This function calculates how much of its max steering force the vehicle has left to apply and then applies that amount of the force to add.
protected accumulateForce ( Vector2D &steeringForce, Vector2D additionalForce ) : bool
steeringForce Vector2D
additionalForce Vector2D
Résultat bool

calculateArriveVector() protected méthode

This behavior is similar to seek but it attempts to arrive at the target with a zero velocity
protected calculateArriveVector ( Vector2D target, DecelerationState decel ) : Vector2D
target Vector2D
decel DecelerationState
Résultat Vector2D

calculateInterposeVector() protected méthode

Given an opponent and an object position this method returns a force that attempts to position the agent between them
protected calculateInterposeVector ( SoccerBall ball, Vector2D target, double distFromTarget ) : Vector2D
ball SoccerBall
target Vector2D
distFromTarget double
Résultat Vector2D

calculatePursuitVector() protected méthode

This behavior creates a force that steers the agent towards the ball
protected calculatePursuitVector ( SoccerBall ball ) : Vector2D
ball SoccerBall
Résultat Vector2D

calculateSeekVector() protected méthode

Given a target, this behavior returns a steering force which will allign the agent with the target and move the agent in the desired direction
protected calculateSeekVector ( Vector2D target ) : Vector2D
target Vector2D
Résultat Vector2D

calculateSeparationVector() protected méthode

This calculates a force repelling from the other neighbors
protected calculateSeparationVector ( ) : Vector2D
Résultat Vector2D

findNeighbours() protected méthode

Tags any vehicles within a predefined radius
protected findNeighbours ( ) : void
Résultat void

sumForces() protected méthode

This method calls each active steering behavior and acumulates their forces until the max steering force magnitude is reached at which time the function returns the steering force accumulated to that point
protected sumForces ( ) : Vector2D
Résultat Vector2D

Property Details

_behaviorFlags protected_oe property

Binary flags to indicate whether or not a behavior should be active
protected int _behaviorFlags
Résultat int

_dribbleFeelers protected_oe property

A vertex buffer to contain the feelers rqd for dribbling
protected List _dribbleFeelers
Résultat List

_separationMultiple protected_oe property

Multipliers.
protected double _separationMultiple
Résultat double