CSWActiveSonar Class Reference

Inheritance diagram for CSWActiveSonar:

Inheritance graph
[legend]
List of all members.

Public Member Functions

const double & getDistance () const
const double & getMaximalDistance () const
bool hasTargetDetected () const
bool isTargetDynamic () const
bool isTargetBorder () const
bool isTargetSubmarine () const
bool isTargetWeapon () const
const Vector3D & getTargetPosition () const

Detailed Description

This class specializes a sonar to an active sonar. The time difference between sent and received sonic waves gives the distance to detected solid objects within a small region. The three modes for direction, velocity and range have now additional meanings:

Detected objects are reported to the map.
Warning:
Objects closer than 60m are not detected.


Member Function Documentation

const double & CSWActiveSonar::getDistance (  )  const

Returns the distance from the sensor to the detected object.

Returns:
The distance from the sensor to the currently detected object. If no object has been detected getMaximalDistance() is returned.

const double & CSWActiveSonar::getMaximalDistance (  )  const

Returns the maximal distance within objects can be detected.

Returns:
The maximal distance within objects can be detected.

bool CSWActiveSonar::hasTargetDetected (  )  const

Returns true if an object has been detected otherwise false

Returns:
True if an object has been detected otherwise false.

bool CSWActiveSonar::isTargetDynamic (  )  const

Returns true if a dynamic object has been detected.

Returns:
True if a dynamic object has been detected.

bool CSWActiveSonar::isTargetBorder (  )  const

Returns true if a world border has been detected.

Returns:
True if a world border has been detected.

bool CSWActiveSonar::isTargetSubmarine (  )  const

Returns true if a submarine has been detected.

Returns:
True if a submarine has been detected.

bool CSWActiveSonar::isTargetWeapon (  )  const

Returns true if a weapon has been detected.

Returns:
True if a weapon has been detected.

const Vector3D & CSWActiveSonar::getTargetPosition (  )  const

Returns the position of the detection in world coordinates.

Returns:
The position of the detection in world coordinates. If no object has been detected Vector3(0, 0, 0) is returned.


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