Modifier and Type | Field and Description |
---|---|
static int |
DetectionRange
The Detection range.
|
static int |
SeparationRange
The Separation range.
|
Constructor and Description |
---|
Bird(java.awt.Color birdColor)
This constructor sets a random location and direction for the bird.
|
Modifier and Type | Method and Description |
---|---|
java.awt.Color |
getColor()
Get the color of this bird
|
float |
getDistance(Bird otherBird)
Get the distance in pixels between this bird and another
|
float |
getDistance(com.jme3.math.Vector2f p)
Get the distance in pixels between this bird and a point
|
com.jme3.math.Vector2f |
getLocation()
Get the current location of this bird
|
float |
getMaxTurnTheta()
Get the current direction that the bird is facing
|
IItem |
getRepresentation()
Gets the representation.
|
float |
getTheta()
Get the current direction of this bird
|
void |
move(float newHeading)
Causes the bird to attempt to face a new direction.
|
void |
setLocation(com.jme3.math.Vector2f pos)
Sets the location.
|
void |
setMaxTurnTheta(float theta)
Set the maximum turn capability of the bird for each movement.
|
void |
setRepresentation(IItem rep)
Sets the representation.
|
void |
setSpeed(double speed)
Set the current speed of the bird
|
void |
updateRepresentationPosition()
Update representation position.
|
void |
updateRepresentationRotation()
Update representation rotation.
|
public static int DetectionRange
public static int SeparationRange
public Bird(java.awt.Color birdColor)
birdColor
- The color of the bird.public java.awt.Color getColor()
public float getDistance(Bird otherBird)
otherBird
- The other bird to measure the distance betweenpublic float getDistance(com.jme3.math.Vector2f p)
p
- The point to measure the distance betweenpublic com.jme3.math.Vector2f getLocation()
public float getMaxTurnTheta()
public IItem getRepresentation()
public float getTheta()
public void move(float newHeading)
newHeading
- The direction in degrees that the bird should turn
toward.public void setLocation(com.jme3.math.Vector2f pos)
pos
- the new locationpublic void setMaxTurnTheta(float theta)
theta
- The new maximum turning theta in degreespublic void setRepresentation(IItem rep)
rep
- the new representationpublic void setSpeed(double speed)
speed
- The new speed for the birdpublic void updateRepresentationPosition()
public void updateRepresentationRotation()