TankAIAimGuesser Class Reference

#include <TankAIAimGuesser.h>

Inheritance diagram for TankAIAimGuesser:

PhysicsParticleObjectHandler

List of all members.

Public Member Functions

 TankAIAimGuesser ()
virtual ~TankAIAimGuesser ()
bool guess (Tank *tank, Vector &target, float angleXYDegs, float distance, Vector &actualPosition)
virtual void collision (PhysicsParticleObject &position, ScorchedCollisionId collisionId)
virtual void wallCollision (PhysicsParticleObject &position, ScorchedCollisionId collisionId)

Protected Member Functions

void getCurrentGuess (Tank *tank)
void initialShot (Tank *tank, Vector &target)
void refineShot (Tank *tank, Vector &currentPos, Vector &wantedPos)

Protected Attributes

bool collision_
PhysicsParticleObject currentGuess_


Detailed Description

Definition at line 27 of file TankAIAimGuesser.h.


Constructor & Destructor Documentation

TankAIAimGuesser::TankAIAimGuesser (  ) 

Definition at line 30 of file TankAIAimGuesser.cpp.

TankAIAimGuesser::~TankAIAimGuesser (  )  [virtual]

Definition at line 34 of file TankAIAimGuesser.cpp.


Member Function Documentation

bool TankAIAimGuesser::guess ( Tank tank,
Vector target,
float  angleXYDegs,
float  distance,
Vector actualPosition 
)

Definition at line 38 of file TankAIAimGuesser.cpp.

References FixedVector::asVector(), collision_, currentGuess_, fixed::fromFloat(), getCurrentGuess(), PhysicsParticleObject::getPosition(), Tank::getPosition(), initialShot(), refineShot(), and TankPosition::rotateGunYZ().

Referenced by TankAICurrentMove::makeGroupShot(), and TankAICurrentMove::makeProjectileShot().

void TankAIAimGuesser::collision ( PhysicsParticleObject position,
ScorchedCollisionId  collisionId 
) [virtual]

Implements PhysicsParticleObjectHandler.

Definition at line 140 of file TankAIAimGuesser.cpp.

References collision_, and currentGuess_.

void TankAIAimGuesser::wallCollision ( PhysicsParticleObject position,
ScorchedCollisionId  collisionId 
) [virtual]

Reimplemented from PhysicsParticleObjectHandler.

Definition at line 147 of file TankAIAimGuesser.cpp.

References collision_, and currentGuess_.

void TankAIAimGuesser::getCurrentGuess ( Tank tank  )  [protected]

Definition at line 156 of file TankAIAimGuesser.cpp.

References collision_, Target::getPlayerId(), Tank::getPosition(), TankPosition::getPower(), TankPosition::getTankGunPosition(), TankPosition::getVelocityVector(), ScorchedServer::instance(), ParticleTypeShot, PhysicsParticleObject::setHandler(), PhysicsParticleObject::setPhysics(), and PhysicsParticleObject::simulate().

Referenced by guess().

void TankAIAimGuesser::initialShot ( Tank tank,
Vector target 
) [protected]

Definition at line 85 of file TankAIAimGuesser.cpp.

References TankPosition::changePower(), FixedVector::fromVector(), Tank::getPosition(), TankLib::getShotTowardsPosition(), TankPosition::getTankPosition(), ScorchedServer::instance(), TankPosition::rotateGunXY(), and RandomGenerator::seed().

Referenced by guess().

void TankAIAimGuesser::refineShot ( Tank tank,
Vector currentPos,
Vector wantedPos 
) [protected]

Definition at line 107 of file TankAIAimGuesser.cpp.

References atan2x(), TankPosition::changePower(), fixed::fromFloat(), Tank::getPosition(), TankPosition::getPower(), TankPosition::getVelocityVector(), TankPosition::rotateGunXY(), and fixed::XPI.

Referenced by guess().


Member Data Documentation

bool TankAIAimGuesser::collision_ [protected]

Definition at line 44 of file TankAIAimGuesser.h.

Referenced by collision(), getCurrentGuess(), guess(), and wallCollision().

PhysicsParticleObject TankAIAimGuesser::currentGuess_ [protected]

Definition at line 45 of file TankAIAimGuesser.h.

Referenced by collision(), guess(), and wallCollision().


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