#include <CSWPassiveSonar.h>
Public Member Functions | |
virtual const double & | getAngleOfBeam () const |
virtual void | setAngleOfBeam (const double &fAngle) |
virtual const double & | getLevel () const |
void | adjustDirectionToMaximum (const double &fTimeToFind) |
bool | isAdjusting () const |
bool | hasAdjusted () const |
![]() | |
void | setEnableAutomaticRotation (bool bValue) |
bool | isAutomaticRotationEnabled () const |
void | setScanDirectionMode (int directionMode) |
void | setScanVelocityMode (int velocityMode) |
void | setScanRangeMode (int rangeMode) |
ScanDirectionMode | getScanDirectionMode () const |
ScanVelocityMode | getScanVelocityMode () const |
ScanRangeMode | getScanRangeMode () const |
void | setScanDirection (const Vector3D &vecDirection) |
const Vector3D & | getScanDirection () const |
void | pointToGlobalPosition (const Vector3D &vecPosition) |
const Vector3D & | getDirection () const |
![]() | |
bool | isMoving () const |
![]() | |
const std::string & | getName () const |
Additional Inherited Members | |
![]() | |
enum | ScanDirectionMode { FULL = 1 , FRONT = 2 , BACK = 3 , LOCAL_DIRECTION = 4 , GLOBAL_POSITION = 5 } |
enum | ScanVelocityMode { FAST = 1 , SLOW = 2 } |
enum | ScanRangeMode { NEAR_RANGE = 1 , FAR_RANGE = 2 } |
This class specializes a sonar to a passive sonar. It detects environmental sounds of sound emitting objects.
void CodeSubWars::CSWPassiveSonar::adjustDirectionToMaximum | ( | const double & | fTimeToFind | ) |
Adjusts the currently set local direction to point to a maximum level. By doing this the automatic rotation will be disabled and the direction mode is set to LOCAL_DIRECTION.
fTimeToFind | The maximal relative time within the maximum level must be found. If this time has reached the adjusting will stop at the currently found maximum. This time will never be exceeded. |
|
virtual |
Returns the current set angle of beam.
Implements CodeSubWars::CSWISoundReceiver.
|
virtual |
Returns the currently detected sound pressure level (SPL) in decibel (dB). Typical values are (depend on distance):
Main engine of large submarine on max intensity: about 100dB
Jet oars of large submarine on max intensity: about 80dB
Explosion of torpedo/mine: about 150dB
Engine of torpedo: about 30dB
Implements CodeSubWars::CSWISoundReceiver.
bool CodeSubWars::CSWPassiveSonar::hasAdjusted | ( | ) | const |
Returns true if a previously started adjusting has been finished.
bool CodeSubWars::CSWPassiveSonar::isAdjusting | ( | ) | const |
Returns true if the sonar is currently adjusting.
|
virtual |
Sets the current angle of beam within emitted sound are detected. If setting a larger angle the resolution will be decreased. Initially the angle is 15 degree.
fAngle | The angle of beam that should be used in degree. This is clamped to [0, 180]. |
Implements CodeSubWars::CSWISoundReceiver.