C# Класс SimpleSoccer.Net.SteeringBehaviors

Показать файл Открыть проект Примеры использования класса

Защищенные свойства (Protected)

Свойство Тип Описание
_behaviorFlags int
_dribbleFeelers List
_separationMultiple double

Открытые методы

Метод Описание
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

Защищенные методы

Метод Описание
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

Описание методов

CalculateSteeringForce() публичный Метод

Calculates the overall steering force based on the currently active steering behaviors.
public CalculateSteeringForce ( ) : Vector2D
Результат Vector2D

RenderAids() публичный Метод

Render force lines
public RenderAids ( Graphics g ) : void
g System.Drawing.Graphics
Результат void

SteeringBehaviors() публичный Метод

public SteeringBehaviors ( PlayerBase player, SoccerBall ball ) : System
player PlayerBase
ball SoccerBall
Результат System

accumulateForce() защищенный Метод

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
Результат bool

calculateArriveVector() защищенный Метод

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
Результат Vector2D

calculateInterposeVector() защищенный Метод

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
Результат Vector2D

calculatePursuitVector() защищенный Метод

This behavior creates a force that steers the agent towards the ball
protected calculatePursuitVector ( SoccerBall ball ) : Vector2D
ball SoccerBall
Результат Vector2D

calculateSeekVector() защищенный Метод

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
Результат Vector2D

calculateSeparationVector() защищенный Метод

This calculates a force repelling from the other neighbors
protected calculateSeparationVector ( ) : Vector2D
Результат Vector2D

findNeighbours() защищенный Метод

Tags any vehicles within a predefined radius
protected findNeighbours ( ) : void
Результат void

sumForces() защищенный Метод

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
Результат Vector2D

Описание свойств

_behaviorFlags защищенное свойство

Binary flags to indicate whether or not a behavior should be active
protected int _behaviorFlags
Результат int

_dribbleFeelers защищенное свойство

A vertex buffer to contain the feelers rqd for dribbling
protected List _dribbleFeelers
Результат List

_separationMultiple защищенное свойство

Multipliers.
protected double _separationMultiple
Результат double