#include <CSWEngine.h>
Public Member Functions | |
virtual void | setDirection (const double &fHAngle, const double &fVAngle) |
virtual void | setDirection (const Vector3D &vecDirection) |
const Vector3D & | getDirection () const |
void | setIntensity (const double fIntensity) |
const double & | getIntensity () |
Public Member Functions inherited from CodeSubWars::CSWEquipment | |
bool | isMoving () const |
Public Member Functions inherited from CodeSubWars::CSWObject | |
const std::string & | getName () const |
This class encapsulates a machine that can "emit" a force in a direction. The maximal force is depend on the size of the engine (larger engines have more power than smaller ones). This has the property to emit sound that is depend on the currently emitting force.
const Vector3D & CodeSubWars::CSWEngine::getDirection | ( | ) | const |
Returns the normalized direction in the world coordinate system. This is the "forward" direction for positive intensity values.
const double & CodeSubWars::CSWEngine::getIntensity | ( | ) |
Returns the current set normalized intensity in range [-1, 1].
|
virtual |
Sets the direction relative to local initial set coordinate system. If a direction is given that the engine can not adjust, the maximal direction nearest to the given direction will be set. The maximal excursion of the new direction relative to it initial direction is 45 degree. The angular velocity for adjusting is 22.5 degree/second.
fHAngle | The new horizontal angle, positiv means to the right. (in degree) |
fVAngle | The new vertical angle, positiv means to the up. (in degree) |
|
virtual |
Sets the direction relative to local initial set coordinate system. If a direction is given that the engine can not adjust, the maximal direction nearest to the given direction will be set. The maximal excursion of the new direction relative to it initial direction is 45 degree. The angular velocity for adjusting is 22.5 degree/second.
vecDirection | The new direction relative to its parent. |
void CodeSubWars::CSWEngine::setIntensity | ( | const double | fIntensity | ) |
Sets the intensity of the engine relative to its parent. The valid range is [-1, 1], where positive means toward and negative backward direction. Non-valid values are clipped against the valid range.
fIntensity | The new intensity in range [-1, 1]. |