#include <ballstateaspect.h>
Inheritance diagram for BallStateAspect:
Public Member Functions | |
BallStateAspect () | |
virtual | ~BallStateAspect () |
virtual void | Update (float deltaTime) |
called during the update of the GameControlServer to allow the ControlAspect to perform any necessary checks. | |
bool | GetLastCollidingAgent (boost::shared_ptr< oxygen::AgentAspect > &agent, TTime &time) |
returns the last agent that collided with the ball and the time when this happened | |
bool | GetBallOnField () |
returns true if the ball over the playing field | |
salt::Vector3f | GetLastValidBallPosition () |
returns the last valid position of the ball over the playing field | |
TTeamIndex | GetGoalState () |
returns the goal in which the balls position is or TI_NONE otherwise | |
void | UpdateLastCollidingAgent (boost::shared_ptr< oxygen::AgentAspect > agent) |
updates the reference to the last agent that collided with the ball | |
Protected Member Functions | |
virtual void | OnLink () |
set up the reference to the ball and field collider | |
virtual void | OnUnlink () |
reset the reference to the ball and field recorder | |
void | UpdateLastCollidingAgent () |
updates the reference to the last agent that collided with the ball | |
void | UpdateBallOnField () |
checks if the ball is on the playing field an updates the mBallOnField flag | |
void | UpdateGoalState () |
checks if the ball is in one of the goals and updates the mGoalState member | |
void | UpdateLastValidBallPos () |
if the ball has a valid position, i.e. | |
Protected Attributes | |
boost::shared_ptr< Ball > | mBall |
reference to the Ball node | |
boost::shared_ptr< oxygen::RecorderHandler > | mBallRecorder |
reference to the Ball collision recorder | |
boost::shared_ptr< oxygen::RecorderHandler > | mFieldRecorder |
reference to the field collider | |
boost::shared_ptr< oxygen::RecorderHandler > | mLeftGoalRecorder |
reference to the left goal recorder | |
boost::shared_ptr< oxygen::RecorderHandler > | mRightGoalRecorder |
reference to the right goal recorder | |
boost::shared_ptr< oxygen::AgentAspect > | mLastCollidingAgent |
holds a reference to the last agent that collided with the ball | |
boost::shared_ptr< GameStateAspect > | mGameState |
holds a reference to the GameStateAspect | |
TTime | mLastAgentCollisionTime |
then time when the last agent collided with the ball | |
bool | mBallOnField |
true if the ball on the soccer field, i.e. | |
salt::Vector3f | mLastValidBallPos |
holds the last valid ball position | |
TTeamIndex | mGoalState |
indicates in which goal the ball is, TI_NONE otherwise |
Definition at line 38 of file ballstateaspect.h.
|
Definition at line 37 of file ballstateaspect.cpp. References mBallOnField, mGoalState, mLastAgentCollisionTime, mLastValidBallPos, and TI_NONE. |
|
Definition at line 45 of file ballstateaspect.cpp. |
|
returns true if the ball over the playing field
Definition at line 184 of file ballstateaspect.cpp. References mBallOnField. |
|
returns the goal in which the balls position is or TI_NONE otherwise
Definition at line 134 of file ballstateaspect.cpp. References mGoalState. |
|
returns the last agent that collided with the ball and the time when this happened
|
|
returns the last valid position of the ball over the playing field
Definition at line 189 of file ballstateaspect.cpp. References mLastValidBallPos. |
|
set up the reference to the ball and field collider
Reimplemented from SoccerControlAspect. Definition at line 158 of file ballstateaspect.cpp. References SoccerBase::GetBall(), SoccerControlAspect::GetBallRecorder(), oxygen::ControlAspect::GetControlAspect(), SoccerControlAspect::GetFieldRecorder(), SoccerControlAspect::GetLeftGoalRecorder(), SoccerControlAspect::GetRightGoalRecorder(), mBall, mBallRecorder, mFieldRecorder, mGameState, mLeftGoalRecorder, mRightGoalRecorder, and SoccerControlAspect::OnLink(). Here is the call graph for this function: ![]() |
|
reset the reference to the ball and field recorder
Reimplemented from zeitgeist::Leaf. Definition at line 172 of file ballstateaspect.cpp. References mBallRecorder, mFieldRecorder, mGameState, mLastCollidingAgent, mLeftGoalRecorder, mRightGoalRecorder, and zeitgeist::Leaf::OnUnlink(). Here is the call graph for this function: ![]() |
|
called during the update of the GameControlServer to allow the ControlAspect to perform any necessary checks.
Implements oxygen::ControlAspect. Definition at line 139 of file ballstateaspect.cpp. References mBall, mBallRecorder, mFieldRecorder, mLeftGoalRecorder, mRightGoalRecorder, UpdateBallOnField(), UpdateGoalState(), UpdateLastCollidingAgent(), and UpdateLastValidBallPos(). Here is the call graph for this function: ![]() |
|
checks if the ball is on the playing field an updates the mBallOnField flag
Definition at line 84 of file ballstateaspect.cpp. References mBallOnField, and mFieldRecorder. Referenced by Update(). |
|
checks if the ball is in one of the goals and updates the mGoalState member
Definition at line 108 of file ballstateaspect.cpp. References mGoalState, mLeftGoalRecorder, mRightGoalRecorder, TI_LEFT, TI_NONE, and TI_RIGHT. Referenced by Update(). |
|
updates the reference to the last agent that collided with the ball
Definition at line 58 of file ballstateaspect.cpp. References mBallRecorder, mGameState, mLastAgentCollisionTime, and mLastCollidingAgent. Referenced by Update(). |
|
updates the reference to the last agent that collided with the ball
Definition at line 78 of file ballstateaspect.cpp. References mGameState, mLastAgentCollisionTime, and mLastCollidingAgent. |
|
if the ball has a valid position, i.e. is on the field, remember it Definition at line 98 of file ballstateaspect.cpp. References mBall, mBallOnField, and mLastValidBallPos. Referenced by Update(). |
|
reference to the Ball node
Definition at line 98 of file ballstateaspect.h. Referenced by OnLink(), Update(), and UpdateLastValidBallPos(). |
|
true if the ball on the soccer field, i.e. not on the border surrounding the soccer field Definition at line 124 of file ballstateaspect.h. Referenced by BallStateAspect(), GetBallOnField(), UpdateBallOnField(), and UpdateLastValidBallPos(). |
|
reference to the Ball collision recorder
Definition at line 101 of file ballstateaspect.h. Referenced by OnLink(), OnUnlink(), Update(), and UpdateLastCollidingAgent(). |
|
reference to the field collider
Definition at line 104 of file ballstateaspect.h. Referenced by OnLink(), OnUnlink(), Update(), and UpdateBallOnField(). |
|
holds a reference to the GameStateAspect
Definition at line 117 of file ballstateaspect.h. Referenced by OnLink(), OnUnlink(), and UpdateLastCollidingAgent(). |
|
indicates in which goal the ball is, TI_NONE otherwise
Definition at line 130 of file ballstateaspect.h. Referenced by BallStateAspect(), GetGoalState(), and UpdateGoalState(). |
|
then time when the last agent collided with the ball
Definition at line 120 of file ballstateaspect.h. Referenced by BallStateAspect(), and UpdateLastCollidingAgent(). |
|
holds a reference to the last agent that collided with the ball
Definition at line 114 of file ballstateaspect.h. Referenced by OnUnlink(), and UpdateLastCollidingAgent(). |
|
holds the last valid ball position
Definition at line 127 of file ballstateaspect.h. Referenced by BallStateAspect(), GetLastValidBallPosition(), and UpdateLastValidBallPos(). |
|
reference to the left goal recorder
Definition at line 107 of file ballstateaspect.h. Referenced by OnLink(), OnUnlink(), Update(), and UpdateGoalState(). |
|
reference to the right goal recorder
Definition at line 110 of file ballstateaspect.h. Referenced by OnLink(), OnUnlink(), Update(), and UpdateGoalState(). |