C# Class SimpleSoccer.Net.SteeringBehaviors

Datei anzeigen Open project: soshimozi/SimpleSoccer.Net Class Usage Examples

Protected Properties

Property Type Description
_behaviorFlags int
_dribbleFeelers List
_separationMultiple double

Public Methods

Method 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

Protected Methods

Method 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 method

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

RenderAids() public method

Render force lines
public RenderAids ( Graphics g ) : void
g System.Drawing.Graphics
return void

SteeringBehaviors() public method

public SteeringBehaviors ( PlayerBase player, SoccerBall ball ) : System
player PlayerBase
ball SoccerBall
return System

accumulateForce() protected method

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
return bool

calculateArriveVector() protected method

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
return Vector2D

calculateInterposeVector() protected method

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
return Vector2D

calculatePursuitVector() protected method

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

calculateSeekVector() protected method

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
return Vector2D

calculateSeparationVector() protected method

This calculates a force repelling from the other neighbors
protected calculateSeparationVector ( ) : Vector2D
return Vector2D

findNeighbours() protected method

Tags any vehicles within a predefined radius
protected findNeighbours ( ) : void
return void

sumForces() protected method

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
return Vector2D

Property Details

_behaviorFlags protected_oe property

Binary flags to indicate whether or not a behavior should be active
protected int _behaviorFlags
return int

_dribbleFeelers protected_oe property

A vertex buffer to contain the feelers rqd for dribbling
protected List _dribbleFeelers
return List

_separationMultiple protected_oe property

Multipliers.
protected double _separationMultiple
return double