CSWEngine Class Reference

Inheritance diagram for CSWEngine:

Inheritance graph
[legend]
List of all members.

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 ()

Detailed Description

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.


Member Function Documentation

void CSWEngine::setDirection ( const double &  fHAngle,
const double &  fVAngle 
) [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.

Parameters:
fHAngle The new horizontal angle, positiv means to the right. (in degree)
fVAngle The new vertical angle, positiv means to the up. (in degree)

void CSWEngine::setDirection ( const Vector3D &  vecDirection  )  [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.

Parameters:
vecDirection The new direction relative to its parent.

const Vector3D & CSWEngine::getDirection (  )  const

Returns the normalized direction in the world coordinate system. This is the "forward" direction for positive intensity values.

Returns:
The current direction in woorld coordinate system.

void 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.

Parameters:
fIntensity The new intensity in range [-1, 1].

const double & CSWEngine::getIntensity (  ) 

Returns the current set normalized intensity in range [-1, 1].


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