public abstract class VisibleObject extends java.lang.Object implements IVisibleObject, java.io.Serializable
Constructor and Description |
---|
VisibleObject(java.lang.String name)
Default constructor, initializes all fields to zero/null
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object other) |
float |
getAge(float currentTime)
Returns the delta of current time passed and the last time this object was
seen
|
double |
getCollisionDistance() |
Angle |
getDirectionTo(IVisibleObject other)
Calculates the Direction of this visible object to the passed one
|
Angle |
getDirectionTo(org.apache.commons.math3.geometry.euclidean.threed.Vector3D other)
Calculates the global absolute Direction of this visible object to the
passed Vector3D
|
double |
getDistanceToXY(IVisibleObject other) |
double |
getDistanceToXY(org.apache.commons.math3.geometry.euclidean.threed.Vector3D other) |
double |
getDistanceToXYZ(IVisibleObject other)
Calculates the distance of this visible object to the passed one
|
double |
getDistanceToXYZ(org.apache.commons.math3.geometry.euclidean.threed.Vector3D other)
Calculates the distance of this visible object to the passed position
|
InformationSource |
getInformationSource() |
float |
getLastSeenTime() |
org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
getLocalPosition()
Retrieves the local position of the visible object.
|
java.lang.String |
getName() |
org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
getPosition() |
org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
getPreviousPosition() |
int |
hashCode() |
boolean |
isLaying()
Check if the object lies on the ground.
|
boolean |
isVisible() |
void |
setPosition(org.apache.commons.math3.geometry.euclidean.threed.Vector3D pos)
Setting this objects position is usually done when updating the object.
|
void |
setVisible(boolean state)
Set visible state
|
void |
updateFromAudio(org.apache.commons.math3.geometry.euclidean.threed.Vector3D localPosition,
org.apache.commons.math3.geometry.euclidean.threed.Vector3D globalPosition,
float time)
Updates this object's position due to hearing
|
void |
updateFromVision(org.apache.commons.math3.geometry.euclidean.threed.Vector3D localPosition,
org.apache.commons.math3.geometry.euclidean.threed.Vector3D globalPosition,
float time)
Updates this object with the latest perception
|
void |
updateNoVision(org.apache.commons.math3.geometry.euclidean.threed.Vector3D newPosition,
float globalTime) |
public VisibleObject(java.lang.String name)
name
- Object namepublic java.lang.String getName()
getName
in interface IVisibleObject
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getPosition()
getPosition
in interface IVisibleObject
public void setPosition(org.apache.commons.math3.geometry.euclidean.threed.Vector3D pos)
pos
- New positionpublic org.apache.commons.math3.geometry.euclidean.threed.Vector3D getPreviousPosition()
getPreviousPosition
in interface IVisibleObject
public float getLastSeenTime()
getLastSeenTime
in interface IVisibleObject
public void updateFromVision(org.apache.commons.math3.geometry.euclidean.threed.Vector3D localPosition, org.apache.commons.math3.geometry.euclidean.threed.Vector3D globalPosition, float time)
localPosition
- - the local position as observed in the root body
systemglobalPosition
- - the calculated global position of this visible
objecttime
- - time the current absolute timepublic void updateFromAudio(org.apache.commons.math3.geometry.euclidean.threed.Vector3D localPosition, org.apache.commons.math3.geometry.euclidean.threed.Vector3D globalPosition, float time)
globalPosition
- the position of the object in global coordinatespublic double getDistanceToXY(org.apache.commons.math3.geometry.euclidean.threed.Vector3D other)
getDistanceToXY
in interface IVisibleObject
other
- the point to which to calculatepublic double getDistanceToXY(IVisibleObject other)
getDistanceToXY
in interface IVisibleObject
other
- the point to which to calculatepublic double getDistanceToXYZ(IVisibleObject other)
getDistanceToXYZ
in interface IVisibleObject
other
- the object to which to calculate distancepublic double getDistanceToXYZ(org.apache.commons.math3.geometry.euclidean.threed.Vector3D other)
getDistanceToXYZ
in interface IVisibleObject
other
- the position to which to calculate distancepublic Angle getDirectionTo(IVisibleObject other)
getDirectionTo
in interface IVisibleObject
other
- the object to which to calculate directionpublic Angle getDirectionTo(org.apache.commons.math3.geometry.euclidean.threed.Vector3D other)
getDirectionTo
in interface IVisibleObject
other
- the Vector3D to which to calculate directionpublic org.apache.commons.math3.geometry.euclidean.threed.Vector3D getLocalPosition()
IVisibleObject
getLocalPosition
in interface IVisibleObject
public void setVisible(boolean state)
state
- New statepublic boolean isVisible()
isVisible
in interface IVisibleObject
public float getAge(float currentTime)
IVisibleObject
getAge
in interface IVisibleObject
currentTime
- the current global timepublic boolean equals(java.lang.Object other)
equals
in class java.lang.Object
public double getCollisionDistance()
getCollisionDistance
in interface IVisibleObject
public boolean isLaying()
IVisibleObject
isLaying
in interface IVisibleObject
public InformationSource getInformationSource()
getInformationSource
in interface IVisibleObject
public int hashCode()
hashCode
in class java.lang.Object
public void updateNoVision(org.apache.commons.math3.geometry.euclidean.threed.Vector3D newPosition, float globalTime)
globalTime
-