#include <TargetSpace.h>
Public Member Functions | |
| TargetSpace () | |
| virtual | ~TargetSpace () |
| void | updateTarget (Target *target) |
| void | setContext (ScorchedContext *context) |
| Target * | getCollision (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 | |
| ScorchedContext * | context_ |
| Square * | squares_ |
| int | spaceX_ |
| int | spaceY_ |
| int | spaceW_ |
| int | spaceH_ |
| int | spaceWSq_ |
| int | spaceHSq_ |
| int | spaceSq_ |
| int | noSquares_ |
Private Member Functions | |
| TargetSpace (TargetSpace &other) | |
| TargetSpace & | operator= (TargetSpace &other) |
Classes | |
| class | Square |
Definition at line 30 of file TargetSpace.h.
| TargetSpace::TargetSpace | ( | ) |
Definition at line 33 of file TargetSpace.cpp.
References noSquares_, spaceH_, spaceHSq_, spaceSq_, spaceW_, spaceWSq_, and squares_.
| TargetSpace::~TargetSpace | ( | ) | [virtual] |
| TargetSpace::TargetSpace | ( | TargetSpace & | other | ) | [private] |
| 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().
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] |
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] |
int TargetSpace::spaceY_ [protected] |
int TargetSpace::spaceW_ [protected] |
int TargetSpace::spaceH_ [protected] |
int TargetSpace::spaceWSq_ [protected] |
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().
1.5.3