ShotProjectile Class Reference

#include <ShotProjectile.h>

Inheritance diagram for ShotProjectile:

PhysicsParticleReferenced PhysicsParticle Action PhysicsParticleObjectHandler

List of all members.

Public Member Functions

 ShotProjectile (FixedVector &startPosition, FixedVector &velocity, WeaponProjectile *weapon, WeaponFireContext &weaponContext, unsigned int flareType, fixed spinSpeed)
virtual ~ShotProjectile ()
virtual void simulate (fixed frameTime, bool &remove)
virtual void init ()
virtual void collision (PhysicsParticleObject &position, ScorchedCollisionId collisionId)
virtual std::string getActionDetails ()
unsigned int getPlayerId ()
WeaponProjectilegetWeapon ()
std::list
< RenderTracer::TracerLinePoint > & 
getPositions ()

Protected Member Functions

void doCollision (FixedVector &position)

Protected Attributes

FixedVector startPosition_
FixedVector velocity_
WeaponProjectileweapon_
ViewPoints::ViewPointvPoint_
WeaponFireContext weaponContext_
unsigned int flareType_
bool up_
fixed snapTime_
fixed totalTime_
fixed thrustTime_
fixed thrustAmount_
fixed drag_
fixed timedCollision_
fixed spinSpeed_
std::list
< RenderTracer::TracerLinePoint
positions_

Private Member Functions

 ShotProjectile (const ShotProjectile &)
const ShotProjectileoperator= (const ShotProjectile &)


Detailed Description

Definition at line 33 of file ShotProjectile.h.


Constructor & Destructor Documentation

ShotProjectile::ShotProjectile ( FixedVector startPosition,
FixedVector velocity,
WeaponProjectile weapon,
WeaponFireContext weaponContext,
unsigned int  flareType,
fixed  spinSpeed 
)

Definition at line 37 of file ShotProjectile.cpp.

ShotProjectile::~ShotProjectile (  )  [virtual]

Definition at line 80 of file ShotProjectile.cpp.

References Action::context_, ScorchedContext::getViewPoints(), ViewPoints::releaseViewPoint(), and vPoint_.

ShotProjectile::ShotProjectile ( const ShotProjectile  )  [private]


Member Function Documentation

void ShotProjectile::simulate ( fixed  frameTime,
bool &  remove 
) [virtual]

Reimplemented from PhysicsParticle.

Definition at line 130 of file ShotProjectile.cpp.

References PhysicsParticle::applyForce(), fixed::asFloat(), FixedVector::asVector(), LandscapeTex::border, Action::context_, RenderTracer::TracerLinePoint::cross, doCollision(), drag_, LandscapeTexType::eWater, PhysicsParticle::getCurrentPosition(), PhysicsParticle::getCurrentVelocity(), LandscapeMaps::getDefinitions(), ScorchedContext::getLandscapeMaps(), ScorchedContext::getServerMode(), WeaponProjectile::getShowShotPath(), LandscapeDefinitionCache::getTex(), LandscapeTexType::getType(), getWeapon(), LandscapeTexBorderWater::height, RenderTracer::TracerLinePoint::position, positions_, ViewPoints::ViewPoint::setLookFrom(), ViewPoints::ViewPoint::setPosition(), PhysicsParticle::simulate(), snapTime_, FixedVector::StoreNormalize(), thrustAmount_, thrustTime_, timedCollision_, totalTime_, up_, and vPoint_.

void ShotProjectile::init (  )  [virtual]

Implements Action.

Definition at line 50 of file ShotProjectile.cpp.

References fixed::asFloat(), Action::context_, drag_, flareType_, WeaponProjectile::getDrag(), ViewPoints::getNewViewPoint(), WeaponFireContext::getPlayerId(), WeaponProjectile::getScale(), ScorchedContext::getServerMode(), WeaponProjectile::getThrustAmount(), WeaponProjectile::getThrustTime(), WeaponProjectile::getTimedCollision(), WeaponProjectile::getUnder(), ScorchedContext::getViewPoints(), WeaponProjectile::getWallCollision(), getWeapon(), WeaponProjectile::getWindFactor(), ParticleTypeShot, Action::setActionRender(), PhysicsParticle::setPhysics(), spinSpeed_, startPosition_, thrustAmount_, thrustTime_, timedCollision_, velocity_, vPoint_, weapon_, and weaponContext_.

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

Reimplemented from PhysicsParticle.

Definition at line 85 of file ShotProjectile.cpp.

References PhysicsParticle::collision(), PhysicsParticle::collision_, Action::context_, doCollision(), TankContainer::getAllTanks(), PhysicsParticle::getCurrentPosition(), getPlayerId(), PhysicsParticleObject::getPosition(), TankState::getSpectator(), TankState::getState(), Tank::getState(), Tank::getTankAI(), ScorchedContext::getTankContainer(), getWeapon(), TankAI::shotLanded(), and TankState::sNormal.

std::string ShotProjectile::getActionDetails (  )  [virtual]

Reimplemented from Action.

Definition at line 72 of file ShotProjectile.cpp.

References S3D::formatStringBuffer(), Accessory::getName(), AccessoryPart::getParent(), startPosition_, velocity_, and weapon_.

unsigned int ShotProjectile::getPlayerId (  )  [inline]

Definition at line 49 of file ShotProjectile.h.

References WeaponFireContext::getPlayerId(), and weaponContext_.

Referenced by collision(), and MissileActionRenderer::draw().

WeaponProjectile* ShotProjectile::getWeapon (  )  [inline]

Definition at line 50 of file ShotProjectile.h.

References weapon_.

Referenced by collision(), doCollision(), MissileActionRenderer::draw(), init(), PhysicsParticleActionObject::shotShieldHit(), simulate(), and MissileActionRenderer::simulate().

std::list<RenderTracer::TracerLinePoint>& ShotProjectile::getPositions (  )  [inline]

Definition at line 52 of file ShotProjectile.h.

References positions_.

Referenced by MissileActionRenderer::draw().

void ShotProjectile::doCollision ( FixedVector position  )  [protected]

Definition at line 230 of file ShotProjectile.cpp.

References FixedVector::asVector(), Action::context_, Weapon::fireWeapon(), WeaponProjectile::getCollisionAction(), PhysicsParticle::getCurrentVelocity(), WeaponFireContext::getPlayerId(), ScorchedContext::getServerMode(), WeaponProjectile::getShowEndPoint(), WeaponProjectile::getShowShotPath(), getWeapon(), RenderTracer::instance(), positions_, and weaponContext_.

Referenced by collision(), and simulate().

const ShotProjectile& ShotProjectile::operator= ( const ShotProjectile  )  [private]


Member Data Documentation

FixedVector ShotProjectile::startPosition_ [protected]

Definition at line 56 of file ShotProjectile.h.

Referenced by getActionDetails(), and init().

FixedVector ShotProjectile::velocity_ [protected]

Definition at line 56 of file ShotProjectile.h.

Referenced by getActionDetails(), and init().

WeaponProjectile* ShotProjectile::weapon_ [protected]

Definition at line 57 of file ShotProjectile.h.

Referenced by getActionDetails(), getWeapon(), and init().

ViewPoints::ViewPoint* ShotProjectile::vPoint_ [protected]

Definition at line 58 of file ShotProjectile.h.

Referenced by init(), simulate(), and ~ShotProjectile().

WeaponFireContext ShotProjectile::weaponContext_ [protected]

Definition at line 59 of file ShotProjectile.h.

Referenced by doCollision(), getPlayerId(), and init().

unsigned int ShotProjectile::flareType_ [protected]

Definition at line 60 of file ShotProjectile.h.

Referenced by init().

bool ShotProjectile::up_ [protected]

Definition at line 61 of file ShotProjectile.h.

Referenced by simulate().

fixed ShotProjectile::snapTime_ [protected]

Definition at line 62 of file ShotProjectile.h.

Referenced by simulate().

fixed ShotProjectile::totalTime_ [protected]

Definition at line 63 of file ShotProjectile.h.

Referenced by simulate().

fixed ShotProjectile::thrustTime_ [protected]

Definition at line 66 of file ShotProjectile.h.

Referenced by init(), and simulate().

fixed ShotProjectile::thrustAmount_ [protected]

Definition at line 67 of file ShotProjectile.h.

Referenced by init(), and simulate().

fixed ShotProjectile::drag_ [protected]

Definition at line 68 of file ShotProjectile.h.

Referenced by init(), and simulate().

fixed ShotProjectile::timedCollision_ [protected]

Definition at line 69 of file ShotProjectile.h.

Referenced by init(), and simulate().

fixed ShotProjectile::spinSpeed_ [protected]

Definition at line 70 of file ShotProjectile.h.

Referenced by init().

std::list<RenderTracer::TracerLinePoint> ShotProjectile::positions_ [protected]

Definition at line 72 of file ShotProjectile.h.

Referenced by doCollision(), getPositions(), and simulate().


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