public class Scan
extends java.lang.Object
implements java.io.Serializable, java.lang.Cloneable
Modifier and Type | Field and Description |
---|---|
double |
distanceToTarget
Scanned distance at the time of scan.
|
Angle |
scanAperture
Aperture of the scan at the time of scan.
|
Angle |
scanDirection
Direction of the scanner at the time of scan.
|
Vector |
scannerPosition
Position of the scanner at scan time.
|
double |
timeOfScan
time of scan [s].
|
Constructor and Description |
---|
Scan(Angle scanDirection,
Angle scanAperture,
double distanceToTarget,
Vector scannerPosition,
double timeOfScan)
Initializes all final fields.
|
Modifier and Type | Method and Description |
---|---|
Vector |
estimatedTargetPosition()
Estimates the target's position accoring to the scanned values.
|
double |
getArcLength()
This method retrieves the length of the arc at which the scanned target is located.
|
boolean |
isTargetLocated()
Gives the information whether this scan has detected an enemy or not.
|
public final double distanceToTarget
If no target was found inside the scanned cone the distance is 0.
Note: The distance to target may be outdated at a later time.
If you need the distance to the given direction use
getPosition().distanceTo(estimatedTargetPosition())
public final Angle scanAperture
public final Angle scanDirection
public final Vector scannerPosition
public final double timeOfScan
public Vector estimatedTargetPosition()
Note: The vector is given in global coordinates and is not relative to the own position.
scannerPosition.add(new Vector(scanDirection, distanceToTarget))
public double getArcLength()
One can say that the longer the arc the more miserable is the scan.
scanAperture.getValueAsRadians() * distanceToTarget
public boolean isTargetLocated()