Contents
Interface IPositionProvider
- All Known Implementing Classes:
CachedPositionProvider, EntityPositionProvider, PositionProvider, PositionSetProvider, ScopedPositionProvider
public interface IPositionProvider
Get positional information a sensor returns in matching state.
-
Method Summary
Modifier and TypeMethodDescriptionvoidclear()Reset position provider so that hasPosition() will return false.Return target entity if sensor provides it currently.doublegetX()Return x coordinate of available position.doublegetY()Return y coordinate of available position.doublegetZ()Return z coordinate of available position.booleanTest if PositionProvider does return a position currently.default booleanWrites the orientation of the current (primary) position intoout, when one is available.booleanprovidePosition(org.joml.Vector3d result) Test and return sensor positional result if available.
-
Method Details
-
hasPosition
boolean hasPosition()Test if PositionProvider does return a position currently.- Returns:
- if true providePosition and getX/Y/Z will return positional result of sensor
-
providePosition
boolean providePosition(org.joml.Vector3d result) Test and return sensor positional result if available.- Parameters:
result- Vector3d receiving position information if available- Returns:
- True if position is available and result was updated, false if no position available
-
getX
double getX()Return x coordinate of available position.- Returns:
- Coordinate if position available else result is undefined.
-
getY
double getY()Return y coordinate of available position.- Returns:
- Coordinate if position available else result is undefined.
-
getZ
double getZ()Return z coordinate of available position.- Returns:
- Coordinate if position available else result is undefined.
-
getTarget
Return target entity if sensor provides it currently.A sensor might return a valid position but return a null value here if this position does not correlate to an entity.
- Returns:
- entity ref if sensor is matching and result refers to an entity, else null.
-
provideOrientation
Writes the orientation of the current (primary) position intoout, when one is available.- Returns:
- true if an orientation was written, false otherwise (in which case
outis left untouched).
-
clear
void clear()Reset position provider so that hasPosition() will return false.
-