TankLib Namespace Reference


Functions

fixed getDistanceToTank (FixedVector &position, Tank *targetTank)
void getTanksSortedByDistance (ScorchedContext &context, FixedVector &position, std::list< std::pair< fixed, Tank * > > &result, unsigned int teams, fixed maxDistance)
bool intersection (ScorchedContext &context, FixedVector position, fixed xy, fixed yz, fixed power, int dist)
bool getSniperShotTowardsPosition (ScorchedContext &context, FixedVector &position, FixedVector &shootAt, fixed distForSniper, fixed &angleXYDegs, fixed &angleYZDegs, fixed &power, bool checkIntersection)
void getShotTowardsPosition (ScorchedContext &context, RandomGenerator &random, FixedVector &position, FixedVector &shootAt, fixed &angleXYDegs, fixed &angleYZDegs, fixed &power)
FixedVectorgetVelocityVector (fixed xy, fixed yz)
FixedVectorgetGunPosition (fixed xy, fixed yz)


Function Documentation

fixed TankLib::getDistanceToTank ( FixedVector position,
Tank targetTank 
)

Definition at line 34 of file TankLib.cpp.

References Tank::getPosition(), and TankPosition::getTankPosition().

Referenced by getTanksSortedByDistance().

FixedVector & TankLib::getGunPosition ( fixed  xy,
fixed  yz 
)

Definition at line 215 of file TankLib.cpp.

References fixed::cos(), degToRad, fixed::sin(), and fixed::XPI.

Referenced by TankPosition::getTankGunPosition().

void TankLib::getShotTowardsPosition ( ScorchedContext context,
RandomGenerator random,
FixedVector position,
FixedVector shootAt,
fixed angleXYDegs,
fixed angleYZDegs,
fixed power 
)

Definition at line 147 of file TankLib.cpp.

References atan2x(), FixedVector::dotP(), FixedVector::get2DPerp(), ScorchedContext::getOptionsTransient(), RandomGenerator::getRandFixed(), OptionsTransient::getWindDirection(), OptionsTransient::getWindOn(), OptionsTransient::getWindSpeed(), FixedVector::Normalize(), and fixed::XPI.

Referenced by WeaponAimedOver::fireWeapon(), and TankAIAimGuesser::initialShot().

bool TankLib::getSniperShotTowardsPosition ( ScorchedContext context,
FixedVector position,
FixedVector shootAt,
fixed  distForSniper,
fixed angleXYDegs,
fixed angleYZDegs,
fixed power,
bool  checkIntersection 
)

Definition at line 105 of file TankLib.cpp.

References atan2x(), intersection(), FixedVector::Magnitude(), and fixed::XPI.

Referenced by WeaponAimedUnder::fireWeapon(), TankAISniperGuesser::guess(), and TankAICurrentMove::makeBurriedShot().

void TankLib::getTanksSortedByDistance ( ScorchedContext context,
FixedVector position,
std::list< std::pair< fixed, Tank * > > &  result,
unsigned int  teams,
fixed  maxDistance 
)

Definition at line 43 of file TankLib.cpp.

References TankContainer::getAllTanks(), getDistanceToTank(), TankState::getState(), Tank::getState(), ScorchedContext::getTankContainer(), Tank::getTeam(), and TankState::sNormal.

Referenced by WeaponAimedUnder::fireWeapon(), and WeaponAimedOver::fireWeapon().

FixedVector & TankLib::getVelocityVector ( fixed  xy,
fixed  yz 
)

Definition at line 203 of file TankLib.cpp.

References fixed::XPI.

Referenced by WeaponRedirect::fireWeapon(), WeaponAimedUnder::fireWeapon(), WeaponAimedOver::fireWeapon(), TankPosition::getVelocityVector(), and intersection().

bool TankLib::intersection ( ScorchedContext context,
FixedVector  position,
fixed  xy,
fixed  yz,
fixed  power,
int  dist 
)

Definition at line 84 of file TankLib.cpp.

References LandscapeMaps::getGroundMaps(), GroundMaps::getInterpHeight(), ScorchedContext::getLandscapeMaps(), and getVelocityVector().

Referenced by getSniperShotTowardsPosition(), and TankAICurrentMove::makeBurriedShot().


Generated on Mon Feb 16 15:15:09 2009 for Scorched3D by  doxygen 1.5.3