Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members

CatchEffector Class Reference

#include <catcheffector.h>

Inheritance diagram for CatchEffector:

Inheritance graph
[legend]
Collaboration diagram for CatchEffector:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 CatchEffector ()
virtual ~CatchEffector ()
virtual bool Realize (boost::shared_ptr< oxygen::ActionObject > action)
 realizes the action described by the ActionObject
virtual std::string GetPredicate ()
 returns the name of the predicate this effector implements.
virtual boost::shared_ptr<
oxygen::ActionObject
GetActionObject (const oxygen::Predicate &predicate)
 constructs an Actionobject, describing a predicate
virtual void OnLink ()
 setup the reference to the ball body node
virtual void OnUnlink ()
 remove the reference to the ball body node
void SetCatchMargin (float margin)
 set the catch margin (the area within objects are catchable)

Protected Member Functions

void MoveBall (const salt::Vector3f &pos)
 moves the ball to pos setting its linear and angular velocity to 0

Protected Attributes

boost::shared_ptr< SoccerRuleAspectmSoccerRule
 reference to the soccer rule aspect
boost::shared_ptr< oxygen::BodymBallBody
 reference to the body node of the ball
boost::shared_ptr< oxygen::AgentAspectmAgent
 reference to the agent aspect
boost::shared_ptr< AgentStatemAgentState
 reference to the agentstate
salt::AABB2 mRightPenaltyArea
 bounding box for the right penalty area
salt::AABB2 mLeftPenaltyArea
 bounding box for the left penalty area
float mFieldLength
 the field length (in meters)
float mGoalWidth
 the goal width (in meters)

Private Attributes

float mCatchMargin
 the margin where objects can be catched
float mPlayerRadius
 radius of the player
float mBallRadius
 radius of the ball

Detailed Description

Definition at line 44 of file catcheffector.h.


Constructor & Destructor Documentation

CatchEffector::CatchEffector  ) 
 

Definition at line 41 of file catcheffector.cpp.

CatchEffector::~CatchEffector  )  [virtual]
 

Definition at line 47 of file catcheffector.cpp.


Member Function Documentation

shared_ptr< ActionObject > CatchEffector::GetActionObject const oxygen::Predicate predicate  )  [virtual]
 

constructs an Actionobject, describing a predicate

Implements oxygen::Effector.

Definition at line 154 of file catcheffector.cpp.

References zeitgeist::Object::GetLog(), GetPredicate(), and oxygen::Predicate::name.

Here is the call graph for this function:

virtual std::string CatchEffector::GetPredicate  )  [inline, virtual]
 

returns the name of the predicate this effector implements.

Implements oxygen::Effector.

Definition at line 54 of file catcheffector.h.

Referenced by GetActionObject().

void CatchEffector::MoveBall const salt::Vector3f pos  )  [protected]
 

moves the ball to pos setting its linear and angular velocity to 0

Definition at line 52 of file catcheffector.cpp.

References mBallBody.

Referenced by Realize().

void CatchEffector::OnLink  )  [virtual]
 

setup the reference to the ball body node

Reimplemented from zeitgeist::Leaf.

Definition at line 175 of file catcheffector.cpp.

References SoccerBase::GetAgentState(), SoccerBase::GetBallBody(), SoccerBase::GetBallCollider(), zeitgeist::Object::GetLog(), zeitgeist::Leaf::GetParent(), SoccerBase::GetSoccerRuleAspect(), SoccerBase::GetSoccerVar(), mAgent, mAgentState, mBallBody, mBallRadius, mFieldLength, mGoalWidth, mLeftPenaltyArea, mPlayerRadius, mRightPenaltyArea, and mSoccerRule.

Here is the call graph for this function:

void CatchEffector::OnUnlink  )  [virtual]
 

remove the reference to the ball body node

Reimplemented from zeitgeist::Leaf.

Definition at line 229 of file catcheffector.cpp.

References mAgent, mAgentState, mBallBody, and mSoccerRule.

bool CatchEffector::Realize boost::shared_ptr< oxygen::ActionObject action  )  [virtual]
 

realizes the action described by the ActionObject

Implements oxygen::Effector.

Definition at line 60 of file catcheffector.cpp.

References salt::AABB2::Contains(), zeitgeist::Object::GetLog(), salt::TVector< DATATYPE, ELEMENTS, TYPE >::Length(), mAgent, mAgentState, mBallBody, mBallRadius, mCatchMargin, mLeftPenaltyArea, MoveBall(), mPlayerRadius, mRightPenaltyArea, mSoccerRule, TI_LEFT, and TI_RIGHT.

Here is the call graph for this function:

void CatchEffector::SetCatchMargin float  margin  ) 
 

set the catch margin (the area within objects are catchable)

Definition at line 238 of file catcheffector.cpp.

References mCatchMargin.


Member Data Documentation

boost::shared_ptr<oxygen::AgentAspect> CatchEffector::mAgent [protected]
 

reference to the agent aspect

Definition at line 79 of file catcheffector.h.

Referenced by OnLink(), OnUnlink(), and Realize().

boost::shared_ptr<AgentState> CatchEffector::mAgentState [protected]
 

reference to the agentstate

Definition at line 81 of file catcheffector.h.

Referenced by OnLink(), OnUnlink(), and Realize().

boost::shared_ptr<oxygen::Body> CatchEffector::mBallBody [protected]
 

reference to the body node of the ball

Definition at line 77 of file catcheffector.h.

Referenced by MoveBall(), OnLink(), OnUnlink(), and Realize().

float CatchEffector::mBallRadius [private]
 

radius of the ball

Definition at line 99 of file catcheffector.h.

Referenced by OnLink(), and Realize().

float CatchEffector::mCatchMargin [private]
 

the margin where objects can be catched

Definition at line 95 of file catcheffector.h.

Referenced by Realize(), and SetCatchMargin().

float CatchEffector::mFieldLength [protected]
 

the field length (in meters)

Definition at line 89 of file catcheffector.h.

Referenced by OnLink().

float CatchEffector::mGoalWidth [protected]
 

the goal width (in meters)

Definition at line 91 of file catcheffector.h.

Referenced by OnLink().

salt::AABB2 CatchEffector::mLeftPenaltyArea [protected]
 

bounding box for the left penalty area

Definition at line 86 of file catcheffector.h.

Referenced by OnLink(), and Realize().

float CatchEffector::mPlayerRadius [private]
 

radius of the player

Definition at line 97 of file catcheffector.h.

Referenced by OnLink(), and Realize().

salt::AABB2 CatchEffector::mRightPenaltyArea [protected]
 

bounding box for the right penalty area

Definition at line 84 of file catcheffector.h.

Referenced by OnLink(), and Realize().

boost::shared_ptr<SoccerRuleAspect> CatchEffector::mSoccerRule [protected]
 

reference to the soccer rule aspect

Definition at line 73 of file catcheffector.h.

Referenced by OnLink(), OnUnlink(), and Realize().


The documentation for this class was generated from the following files:
Generated on Thu Apr 6 15:37:53 2006 for rcssserver3d by  doxygen 1.4.4