public class Player extends MovableObject implements IPlayer
Constructor and Description |
---|
Player(int id,
java.lang.String teamname,
boolean ownTeam)
Constructor
|
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object o) |
Angle |
getBodyDirectionTo(org.apache.commons.math3.geometry.euclidean.threed.Vector3D position)
Returns the relative angle (rad) this player's torso has to the specified
position.
|
org.apache.commons.math3.geometry.euclidean.threed.Vector3D |
getBodyPart(java.lang.String name)
Get position of bodyPart
|
java.util.Map<java.lang.String,org.apache.commons.math3.geometry.euclidean.threed.Vector3D> |
getBodyParts() |
double |
getCollisionDistance() |
org.apache.commons.math3.geometry.euclidean.threed.Rotation |
getGlobalOrientation() |
Angle |
getHorizontalAngle()
Retrieves the horizontal angle of the player with respect to the global
coordinate system.
|
int |
getID() |
double |
getMaxSpeed() |
double |
getPossibleSpeed()
Calculate the maximum possible speed this object can move at in m/cycle
|
java.lang.String |
getTeamname() |
float |
getTimeForBackStep(org.apache.commons.math3.geometry.euclidean.threed.Vector3D position,
Angle directionAtTarget)
Calculates the time a player is expected to take to get from its current
position to the passed position heading in the passed direction running
forward
|
float |
getTimeForSideStep(org.apache.commons.math3.geometry.euclidean.threed.Vector3D position,
Angle directionAtTarget,
boolean left)
Calculates the time a player is expected to take to get from its current
position to the passed position heading in the passed direction by side
stepping
|
float |
getTimeToTurnAndRun(org.apache.commons.math3.geometry.euclidean.threed.Vector3D position,
Angle directionAtTarget)
Calculates the time a player is expected to take to get from its current
position to the passed position heading in the passed direction running
forward
|
boolean |
isGoalie() |
boolean |
isLaying()
Check if the object lies on the ground.
|
boolean |
isOwnTeam() |
void |
setBodyparts(java.util.Map<java.lang.String,org.apache.commons.math3.geometry.euclidean.threed.Vector3D> allBodyParts)
Set visible body parts
|
void |
setGlobalOrientation(org.apache.commons.math3.geometry.euclidean.threed.Rotation orientation)
Set player's global orientation in 3-dimensional space.
|
void |
update(org.apache.commons.math3.geometry.euclidean.threed.Vector3D localPosition,
org.apache.commons.math3.geometry.euclidean.threed.Vector3D globalPosition,
java.util.Map<java.lang.String,org.apache.commons.math3.geometry.euclidean.threed.Vector3D> bodyParts,
float time) |
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
|
getFuturePosition, getFuturePositions, getOldSpeed, getSpeed, isMoving, updateNoVision
getAge, getDirectionTo, getDirectionTo, getDistanceToXY, getDistanceToXY, getDistanceToXYZ, getDistanceToXYZ, getInformationSource, getLastSeenTime, getLocalPosition, getName, getPosition, getPreviousPosition, hashCode, isVisible, setPosition, setVisible, updateNoVision
getClass, notify, notifyAll, toString, wait, wait, wait
getFuturePosition, getFuturePositions, getOldSpeed, getSpeed, isMoving
getAge, getDirectionTo, getDirectionTo, getDistanceToXY, getDistanceToXY, getDistanceToXYZ, getDistanceToXYZ, getInformationSource, getLastSeenTime, getLocalPosition, getName, getPosition, getPreviousPosition, isVisible
public Player(int id, java.lang.String teamname, boolean ownTeam)
id
- The number of the player on the fieldteamname
- The name of the team this player plays inownTeam
- True if this is a player of our own teampublic java.lang.String getTeamname()
getTeamname
in interface IPlayer
public double getPossibleSpeed()
MovableObject
public Angle getBodyDirectionTo(org.apache.commons.math3.geometry.euclidean.threed.Vector3D position)
position
- the position to which to calculate the body anglepublic boolean equals(java.lang.Object o)
equals
in class MovableObject
public boolean isOwnTeam()
public boolean isGoalie()
public Angle getHorizontalAngle()
IPlayer
getHorizontalAngle
in interface IPlayer
public void setGlobalOrientation(org.apache.commons.math3.geometry.euclidean.threed.Rotation orientation)
orientation
- - new orientationpublic org.apache.commons.math3.geometry.euclidean.threed.Rotation getGlobalOrientation()
getGlobalOrientation
in interface IPlayer
public float getTimeToTurnAndRun(org.apache.commons.math3.geometry.euclidean.threed.Vector3D position, Angle directionAtTarget)
getTimeToTurnAndRun
in interface IPlayer
position
- the destination position (global)directionAtTarget
- desired body direction (global, rad) at the
destination positionpublic float getTimeForBackStep(org.apache.commons.math3.geometry.euclidean.threed.Vector3D position, Angle directionAtTarget)
getTimeForBackStep
in interface IPlayer
position
- the destination position (global)directionAtTarget
- desired body direction (global, rad) at the
destination positionpublic float getTimeForSideStep(org.apache.commons.math3.geometry.euclidean.threed.Vector3D position, Angle directionAtTarget, boolean left)
getTimeForSideStep
in interface IPlayer
position
- the destination position (global)directionAtTarget
- desired body direction (global, rad) at the
destination positionleft
- true if we want to step leftpublic boolean isLaying()
IVisibleObject
isLaying
in interface IVisibleObject
isLaying
in class VisibleObject
public org.apache.commons.math3.geometry.euclidean.threed.Vector3D getBodyPart(java.lang.String name)
public java.util.Map<java.lang.String,org.apache.commons.math3.geometry.euclidean.threed.Vector3D> getBodyParts()
getBodyParts
in interface IPlayer
public void setBodyparts(java.util.Map<java.lang.String,org.apache.commons.math3.geometry.euclidean.threed.Vector3D> allBodyParts)
allBodyParts
- List of visible body partspublic double getCollisionDistance()
getCollisionDistance
in interface IVisibleObject
getCollisionDistance
in class VisibleObject
public void updateFromAudio(org.apache.commons.math3.geometry.euclidean.threed.Vector3D localPosition, org.apache.commons.math3.geometry.euclidean.threed.Vector3D globalPosition, float time)
VisibleObject
updateFromAudio
in class MovableObject
globalPosition
- the position of the object in global coordinatespublic void updateFromVision(org.apache.commons.math3.geometry.euclidean.threed.Vector3D localPosition, org.apache.commons.math3.geometry.euclidean.threed.Vector3D globalPosition, float time)
VisibleObject
updateFromVision
in class MovableObject
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 update(org.apache.commons.math3.geometry.euclidean.threed.Vector3D localPosition, org.apache.commons.math3.geometry.euclidean.threed.Vector3D globalPosition, java.util.Map<java.lang.String,org.apache.commons.math3.geometry.euclidean.threed.Vector3D> bodyParts, float time)
public double getMaxSpeed()
getMaxSpeed
in interface IPlayer