CSWCommands Class Reference

List of all members.

Static Public Member Functions

static ARSTD::Command::PtrType setMainEngineIntensity (CSWSubmarine *pSubmarine, double fIntensity)
static ARSTD::Command::PtrType setMainEngineDirection (CSWSubmarine *pSubmarine, const double &fHAngle, const double &fVAngle)
static ARSTD::Command::PtrType setMainEngineDirection (CSWSubmarine *pSubmarine, const Vector3D &vecDirection)
static ARSTD::Command::PtrType disableMainEngine (CSWSubmarine *pSubmarine)
static ARSTD::Command::PtrType setBuoyancyTank (CSWSubmarine *pSubmarine, double fIntensity)
static ARSTD::Command::PtrType disableBuoyancyTank (CSWSubmarine *pSubmarine)
static ARSTD::Command::PtrType setAxialInclinationJetOar (CSWSubmarine *pSubmarine, double fIntensity)
static ARSTD::Command::PtrType disableAxialInclinationJetOar (CSWSubmarine *pSubmarine)
static ARSTD::Command::PtrType disableAllJetOars (CSWSubmarine *pSubmarine)
static ARSTD::Command::PtrType disableAllEngines (CSWSubmarine *pSubmarine)
static ARSTD::Command::PtrType stopRotation (CSWSubmarine *pSubmarine)
static ARSTD::Command::PtrType setOrientationAbsoluteTowardPosition (CSWSubmarine *pSubmarine, const Vector3D &vecPosition, double fRotationTolerance=0.1, double fEndVelocityTolerance=0.3)
static ARSTD::Command::PtrType setOrientationAbsoluteTowardDirection (CSWSubmarine *pSubmarine, const Vector3D &vecDirection, double fRotationTolerance=0.1, double fEndVelocityTolerance=0.3)
static ARSTD::Command::PtrType stopMoving (CSWSubmarine *pSubmarine)
static ARSTD::Command::PtrType moveForward (CSWSubmarine *pSubmarine, double fDistance, double fEndMoveVelocity=0, double fEndMoveVelocityTolerance=0.1)
static ARSTD::Command::PtrType moveUpward (CSWSubmarine *pSubmarine, double fDistance, double fEndMoveVelocity=0, double fEndMoveVelocityTolerance=0.1)
static ARSTD::Command::PtrType stopAll (CSWSubmarine *pSubmarine)
static ARSTD::Command::PtrType fireSalvo (boost::shared_ptr< CSWWeaponBattery > &pWeaponBattery, int nNumTorpedos, double fTimeBetweenLaunches=0)

Detailed Description

This class provides useful predefined macro commands.


Member Function Documentation

Command::PtrType CSWCommands::setMainEngineIntensity ( CSWSubmarine pSubmarine,
double  fIntensity 
) [static]

Creates a new command that sets the intensity of the main engine.

Parameters:
pSubmarine The submarine where the command should be executed (should always be self).
fIntensity The new intensity.
Returns:
Returns the new constructed command.

Command::PtrType CSWCommands::setMainEngineDirection ( CSWSubmarine pSubmarine,
const double &  fHAngle,
const double &  fVAngle 
) [static]

Creates a new command that sets the direction of the main engine.

Parameters:
pSubmarine The submarine where the command should be executed (should always be self).
fHAngle The new horizontal angle. Positiv means rightward (in degree).
fVAngle The new vertical angle. Positiv means upward (in degree).
Returns:
Returns the new constructed command.

Command::PtrType CSWCommands::setMainEngineDirection ( CSWSubmarine pSubmarine,
const Vector3D &  vecDirection 
) [static]

Creates a new command that sets the direction of the main engine.

Parameters:
pSubmarine The submarine where the command should be executed (should always be self).
vecDirection The new direction relative to its parent.
Returns:
Returns the new constructed command.

Command::PtrType CSWCommands::disableMainEngine ( CSWSubmarine pSubmarine  )  [static]

Creates a new command that disables the main engine. (sets the intensity to zero)

Parameters:
pSubmarine The submarine where the command should be executed (should always be self).
Returns:
Returns the new constructed command.

Command::PtrType CSWCommands::setBuoyancyTank ( CSWSubmarine pSubmarine,
double  fIntensity 
) [static]

Creates a new command that sets the intensity of the buoyancy tank.

Parameters:
pSubmarine The submarine where the command should be executed (should always be self).
fIntensity The new intensity.
Returns:
Returns the new constructed command.

Command::PtrType CSWCommands::disableBuoyancyTank ( CSWSubmarine pSubmarine  )  [static]

Creates a new command that disables the buoyancy tank. (sets the intensity to zero)

Parameters:
pSubmarine The submarine where the command should be executed (should always be self).
Returns:
Returns the new constructed command.

Command::PtrType CSWCommands::setAxialInclinationJetOar ( CSWSubmarine pSubmarine,
double  fIntensity 
) [static]

Creates a new command that sets the intensity of the axial inclination jet oar.

Parameters:
pSubmarine The submarine where the command should be executed (should always be self).
fIntensity The new intensity.
Returns:
Returns the new constructed command.

Command::PtrType CSWCommands::disableAxialInclinationJetOar ( CSWSubmarine pSubmarine  )  [static]

Creates a new command that disables the axial inclination jet oar. (sets the intensity to zero)

Parameters:
pSubmarine The submarine where the command should be executed (should always be self).
Returns:
Returns the new constructed command.

Command::PtrType CSWCommands::disableAllJetOars ( CSWSubmarine pSubmarine  )  [static]

Creates a new command that disables the jet oars which are responsible for rotating a submarine.

Parameters:
pSubmarine The submarine where the command should be executed (should always be self).
Returns:
Returns the new constructed command.

Command::PtrType CSWCommands::disableAllEngines ( CSWSubmarine pSubmarine  )  [static]

Creates a new command that disables all engines.

Parameters:
pSubmarine The submarine where the command should be executed (should always be self).
Returns:
Returns the new constructed command.

Command::PtrType CSWCommands::stopRotation ( CSWSubmarine pSubmarine  )  [static]

Creates a new command that controlls the rotation velocity by controlling the intensities of: 1. the axial inclination jet oar, 2. the inclination jet oar and finally the axial inclination jet oar so that the rotation velocity of the submarine is nearly zero end velocity about all axis.

Parameters:
pSubmarine The submarine where the command should be executed (should always be self).
Returns:
Returns the new constructed command.
Postcondition:
The angular velocity is near zero.

Command::PtrType CSWCommands::setOrientationAbsoluteTowardPosition ( CSWSubmarine pSubmarine,
const Vector3D &  vecPosition,
double  fRotationTolerance = 0.1,
double  fEndVelocityTolerance = 0.3 
) [static]

Creates a new command that controlls the absolute orientation by controlling the intensities of: 1. the axial inclination jet oar, 2. the inclination jet oar and finally the axial inclination jet oar so that the submarine is directed to the given absolut position with nearly zero end velocity about all axis.

Parameters:
pSubmarine The submarine where the command should be executed (should always be self).
vecPosition The position in world coorinates to which the subarmine should direct to.
fRotationTolerance The destination rotation tolerance in degree. Should be larger or equal than 0.1.
fEndVelocityTolerance The angular end velocity tolerance in degree per second.
Returns:
Returns the new constructed command.

Command::PtrType CSWCommands::setOrientationAbsoluteTowardDirection ( CSWSubmarine pSubmarine,
const Vector3D &  vecDirection,
double  fRotationTolerance = 0.1,
double  fEndVelocityTolerance = 0.3 
) [static]

Creates a new command that controlls the absolute orientation by controlling the intensities of: 1. the axial inclination jet oar, 2. the inclination jet oar and finally the axial inclination jet oar so that the submarine is directed to the given absolut direction with nearly zero end velocity about all axis.

Parameters:
pSubmarine The submarine where the command should be executed (should always be self).
vecDirection The direction in world coorinates which the subarmine should direct.
fRotationTolerance The destination rotation tolerance in degree. Should be larger or equal than 0.1.
fEndVelocityTolerance The angular end velocity tolerance in degree per second.
Returns:
Returns the new constructed command.

Command::PtrType CSWCommands::stopMoving ( CSWSubmarine pSubmarine  )  [static]

Creates a new command that controlls the translation by controlling the intensities of: main engine and the buoyancy tank. so that the submarine has nearly no end translation velocity.

Parameters:
pSubmarine The submarine where the command should be executed (should always be self).
Postcondition:
The translation velocity is near zero.
Returns:
Returns the new constructed command.

Command::PtrType CSWCommands::moveForward ( CSWSubmarine pSubmarine,
double  fDistance,
double  fEndMoveVelocity = 0,
double  fEndMoveVelocityTolerance = 0.1 
) [static]

Creates a new command that make the submarine moves forward by a given distance.

Parameters:
pSubmarine The submarine where the command should be executed (should always be self).
fDistance The distance that the submarine should move. (positive means forward, negative means backward)
fEndMoveVelocity The end translation velocity in meter per second.
fEndMoveVelocityTolerance The end translation velocity tolerance in degree per second.
Returns:
Returns the new constructed command.

Command::PtrType CSWCommands::moveUpward ( CSWSubmarine pSubmarine,
double  fDistance,
double  fEndMoveVelocity = 0,
double  fEndMoveVelocityTolerance = 0.1 
) [static]

Creates a new command that make the submarine moves upward by a given distance.

Parameters:
pSubmarine The submarine where the command should be executed (should always be self).
fDistance The distance that the submarine should move. (positive means upward, negative means downward)
fEndMoveVelocity The end translation velocity in meter per second.
fEndMoveVelocityTolerance The end translation velocity tolerance in degree per second.
Returns:
Returns the new constructed command.

Command::PtrType CSWCommands::stopAll ( CSWSubmarine pSubmarine  )  [static]

Creates a new command that make the submarine does a full stop. The translation velocity and the rotation velocity becomes nearly zero.

Parameters:
pSubmarine The submarine where the command should be executed (should always be self).
Returns:
Returns the new constructed command.
Postcondition:
The translation and angular velocity is near zero.

Command::PtrType CSWCommands::fireSalvo ( boost::shared_ptr< CSWWeaponBattery > &  pWeaponBattery,
int  nNumTorpedos,
double  fTimeBetweenLaunches = 0 
) [static]

Creates a new command that make the submarine launches weapon from the specified WeaponBattery.

Parameters:
pWeaponBattery The weapon battery from which the weapons should be launched.
nNumTorpedos The number of torpedoes that should be launched.
fTimeBetweenLaunches The time between launches that should be wait in seconds.
Returns:
Returns the new constructed command.


Generated at 2 Jan 2007 for project CodeSubWars. www.codesubwars.org