C# 클래스 SimpleSoccer.Net.SteeringBehaviors

파일 보기 프로젝트 열기: soshimozi/SimpleSoccer.Net 1 사용 예제들

보호된 프로퍼티들

프로퍼티 타입 설명
_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