TargetSpace Class Reference

#include <TargetSpace.h>

List of all members.

Public Member Functions

 TargetSpace ()
virtual ~TargetSpace ()
void updateTarget (Target *target)
void setContext (ScorchedContext *context)
TargetgetCollision (FixedVector &position)
void getCollisionSet (FixedVector &position, fixed radius, std::map< unsigned int, Target * > &collisionTargets, bool ignoreHeight=false)
void draw ()

Protected Member Functions

void normalizeCoords (int &x, int &y)
void getSquares (Target *target, std::vector< Square * > &squares)
void removeTarget (Target *target)

Protected Attributes

ScorchedContextcontext_
Squaresquares_
int spaceX_
int spaceY_
int spaceW_
int spaceH_
int spaceWSq_
int spaceHSq_
int spaceSq_
int noSquares_

Private Member Functions

 TargetSpace (TargetSpace &other)
TargetSpaceoperator= (TargetSpace &other)

Classes

class  Square


Detailed Description

Definition at line 30 of file TargetSpace.h.


Constructor & Destructor Documentation

TargetSpace::TargetSpace (  ) 

Definition at line 33 of file TargetSpace.cpp.

References noSquares_, spaceH_, spaceHSq_, spaceSq_, spaceW_, spaceWSq_, and squares_.

TargetSpace::~TargetSpace (  )  [virtual]

Definition at line 45 of file TargetSpace.cpp.

References squares_.

TargetSpace::TargetSpace ( TargetSpace other  )  [private]


Member Function Documentation

void TargetSpace::updateTarget ( Target target  ) 

Definition at line 50 of file TargetSpace.cpp.

References Target::getAlive(), Target::getLife(), TargetState::getNoCollision(), Target::getPlayerId(), TargetLife::getSpaceContainment(), getSquares(), Target::getTargetState(), removeTarget(), TargetSpace::Square::squarenum, TargetSpaceContainment::squares, and TargetSpace::Square::targets.

Referenced by TargetShield::setCurrentShield(), and TargetLife::updateSpace().

void TargetSpace::setContext ( ScorchedContext context  )  [inline]

Definition at line 37 of file TargetSpace.h.

References context_.

Referenced by ScorchedContext::ScorchedContext().

Target * TargetSpace::getCollision ( FixedVector position  ) 

Definition at line 161 of file TargetSpace.cpp.

References ActionController::addSyncCheck(), TargetLife::collision(), context_, DIALOG_ASSERT, S3D::formatStringBuffer(), Accessory::getAction(), ScorchedContext::getActionController(), Target::getAlive(), Target::getCStrName(), TargetShield::getCurrentShield(), Target::getLife(), ScorchedContext::getOptionsGame(), Target::getPlayerId(), Target::getShield(), TargetLife::getTargetPosition(), Shield::inShield(), Logger::log(), normalizeCoords(), noSquares_, spaceHSq_, squares_, and TargetSpace::Square::targets.

Referenced by PhysicsParticleObject::checkCollision().

void TargetSpace::getCollisionSet ( FixedVector position,
fixed  radius,
std::map< unsigned int, Target * > &  collisionTargets,
bool  ignoreHeight = false 
)

Definition at line 231 of file TargetSpace.cpp.

References ActionController::addSyncCheck(), fixed::asInt(), TargetLife::collisionDistance(), context_, DIALOG_ASSERT, S3D::formatStringBuffer(), ScorchedContext::getActionController(), Target::getAlive(), TargetLife::getCenterPosition(), Target::getCStrName(), fixed::getInternal(), Target::getLife(), ScorchedContext::getOptionsGame(), Target::getPlayerId(), Logger::log(), normalizeCoords(), noSquares_, spaceHSq_, squares_, and TargetSpace::Square::targets.

Referenced by MovementMap::allowedPosition(), TankFalling::collision(), Lightning::damageTargets(), TargetDamageCalc::explosion(), DeformLandscape::flattenArea(), PhysicsParticleObject::getTargetBounceCollision(), TankMovement::moveTank(), Laser::simulate(), Napalm::simulateDamage(), and tankTargetCloseness().

void TargetSpace::draw (  ) 

Definition at line 380 of file TargetSpace.cpp.

References DIALOG_ASSERT, drawBox(), TargetLife::getFloatPosition(), ScorchedContext::getLandscapeMaps(), Target::getLife(), GL_LINES, glBegin(), glColor3f(), glEnd(), glVertex3f(), glVertex3fv(), ScorchedClient::instance(), GLState::LIGHTING_OFF, noSquares_, spaceHSq_, spaceSq_, spaceWSq_, spaceX_, spaceY_, squares_, TargetSpace::Square::targets, and GLState::TEXTURE_OFF.

Referenced by RenderGeoms::drawTargetSpace().

void TargetSpace::normalizeCoords ( int &  x,
int &  y 
) [inline, protected]

Definition at line 62 of file TargetSpace.h.

References MAX, MIN, spaceH_, spaceSq_, spaceW_, spaceX_, and spaceY_.

Referenced by getCollision(), getCollisionSet(), and getSquares().

void TargetSpace::getSquares ( Target target,
std::vector< Square * > &  squares 
) [protected]

Definition at line 93 of file TargetSpace.cpp.

References DIALOG_ASSERT, TargetLife::getAabbSize(), Accessory::getAction(), ShieldRound::getActualRadius(), TargetShield::getCurrentShield(), Target::getLife(), Shield::getRound(), Target::getShield(), ShieldSquare::getSize(), TargetLife::getTargetPosition(), MAX, normalizeCoords(), noSquares_, spaceHSq_, and squares_.

Referenced by updateTarget().

void TargetSpace::removeTarget ( Target target  )  [protected]

Definition at line 148 of file TargetSpace.cpp.

References Target::getLife(), Target::getPlayerId(), TargetLife::getSpaceContainment(), TargetSpaceContainment::squares, squares_, and TargetSpace::Square::targets.

Referenced by updateTarget().

TargetSpace& TargetSpace::operator= ( TargetSpace other  )  [private]


Member Data Documentation

ScorchedContext* TargetSpace::context_ [protected]

Definition at line 54 of file TargetSpace.h.

Referenced by getCollision(), getCollisionSet(), and setContext().

Square* TargetSpace::squares_ [protected]

Definition at line 55 of file TargetSpace.h.

Referenced by draw(), getCollision(), getCollisionSet(), getSquares(), removeTarget(), TargetSpace(), and ~TargetSpace().

int TargetSpace::spaceX_ [protected]

Definition at line 56 of file TargetSpace.h.

Referenced by draw(), and normalizeCoords().

int TargetSpace::spaceY_ [protected]

Definition at line 56 of file TargetSpace.h.

Referenced by draw(), and normalizeCoords().

int TargetSpace::spaceW_ [protected]

Definition at line 57 of file TargetSpace.h.

Referenced by normalizeCoords(), and TargetSpace().

int TargetSpace::spaceH_ [protected]

Definition at line 57 of file TargetSpace.h.

Referenced by normalizeCoords(), and TargetSpace().

int TargetSpace::spaceWSq_ [protected]

Definition at line 58 of file TargetSpace.h.

Referenced by draw(), and TargetSpace().

int TargetSpace::spaceHSq_ [protected]

Definition at line 58 of file TargetSpace.h.

Referenced by draw(), getCollision(), getCollisionSet(), getSquares(), and TargetSpace().

int TargetSpace::spaceSq_ [protected]

Definition at line 59 of file TargetSpace.h.

Referenced by draw(), normalizeCoords(), and TargetSpace().

int TargetSpace::noSquares_ [protected]

Definition at line 60 of file TargetSpace.h.

Referenced by draw(), getCollision(), getCollisionSet(), getSquares(), and TargetSpace().


The documentation for this class was generated from the following files:
Generated on Mon Feb 16 15:15:08 2009 for Scorched3D by  doxygen 1.5.3