CodeSubWars 0.4.7b
CodeSubWars::CSWPassiveSonar Class Reference

#include <CSWPassiveSonar.h>

Inheritance diagram for CodeSubWars::CSWPassiveSonar:

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
- Public Member Functions inherited from CodeSubWars::CSWSonar
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
- Public Member Functions inherited from CodeSubWars::CSWEquipment
bool isMoving () const
- Public Member Functions inherited from CodeSubWars::CSWObject
const std::string & getName () const

Additional Inherited Members

- Public Types inherited from CodeSubWars::CSWSonar
enum  ScanDirectionMode {
  FULL = 1 , FRONT = 2 , BACK = 3 ,
enum  ScanVelocityMode { FAST = 1 , SLOW = 2 }
enum  ScanRangeMode { NEAR_RANGE = 1 , FAR_RANGE = 2 }

Detailed Description

This class specializes a sonar to a passive sonar. It detects environmental sounds of sound emitting objects.

Member Function Documentation

◆ adjustDirectionToMaximum()

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.

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

◆ getAngleOfBeam()

const double & CodeSubWars::CSWPassiveSonar::getAngleOfBeam ( ) const

Returns the current set angle of beam.

The current set angle of beam.

Implements CodeSubWars::CSWISoundReceiver.

◆ getLevel()

const double & CodeSubWars::CSWPassiveSonar::getLevel ( ) const

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

The currently detected sound pressure level in dB.

Implements CodeSubWars::CSWISoundReceiver.

◆ hasAdjusted()

bool CodeSubWars::CSWPassiveSonar::hasAdjusted ( ) const

Returns true if a previously started adjusting has been finished.

True if a previously started adjusting has been finished otherwise false.

◆ isAdjusting()

bool CodeSubWars::CSWPassiveSonar::isAdjusting ( ) const

Returns true if the sonar is currently adjusting.

True if the sonar is currently adjusting otherwise false.

◆ setAngleOfBeam()

void CodeSubWars::CSWPassiveSonar::setAngleOfBeam ( const double &  fAngle)

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.

fAngleThe angle of beam that should be used in degree. This is clamped to [0, 180].

Implements CodeSubWars::CSWISoundReceiver.

Generated at Sun Aug 7 2022 for project CodeSubWars.