T - Type of vector, either 2D or 3D, implementing the Vector interfacepublic class SteerableAdapter<T extends com.badlogic.gdx.math.Vector<T>> extends java.lang.Object implements Steerable<T>
Steerable. You can derive from this and only override what you are interested in. For example,
this comes in handy when you have to create on the fly a target for a particular behavior.| Constructor and Description |
|---|
SteerableAdapter() |
| Modifier and Type | Method and Description |
|---|---|
T |
angleToVector(T outVector,
float angle)
Returns the unit vector in the direction of the specified angle expressed in radians.
|
float |
getAngularVelocity()
Returns the float value indicating the the angular velocity in radians of this Steerable.
|
float |
getBoundingRadius()
Returns the bounding radius of this Steerable.
|
T |
getLinearVelocity()
Returns the vector indicating the linear velocity of this Steerable.
|
float |
getMaxAngularAcceleration()
Returns the maximum angular acceleration.
|
float |
getMaxAngularSpeed()
Returns the maximum angular speed.
|
float |
getMaxLinearAcceleration()
Returns the maximum linear acceleration.
|
float |
getMaxLinearSpeed()
Returns the maximum linear speed.
|
float |
getOrientation()
Returns the float value indicating the orientation of this location.
|
T |
getPosition()
Returns the vector indicating the position of this location.
|
float |
getZeroLinearSpeedThreshold()
Returns the threshold below which the linear speed can be considered zero.
|
boolean |
isTagged()
Returns
true if this Steerable is tagged; false otherwise. |
Location<T> |
newLocation()
Creates a new location.
|
void |
setMaxAngularAcceleration(float maxAngularAcceleration)
Sets the maximum angular acceleration.
|
void |
setMaxAngularSpeed(float maxAngularSpeed)
Sets the maximum angular speed.
|
void |
setMaxLinearAcceleration(float maxLinearAcceleration)
Sets the maximum linear acceleration.
|
void |
setMaxLinearSpeed(float maxLinearSpeed)
Sets the maximum linear speed.
|
void |
setOrientation(float orientation)
Sets the orientation of this location, i.e.
|
void |
setTagged(boolean tagged)
Tag/untag this Steerable.
|
void |
setZeroLinearSpeedThreshold(float value)
Sets the threshold below which the linear speed can be considered zero.
|
float |
vectorToAngle(T vector)
Returns the angle in radians pointing along the specified vector.
|
public float getZeroLinearSpeedThreshold()
LimitergetZeroLinearSpeedThreshold in interface Limiterpublic void setZeroLinearSpeedThreshold(float value)
LimitersetZeroLinearSpeedThreshold in interface Limiterpublic float getMaxLinearSpeed()
LimitergetMaxLinearSpeed in interface Limiterpublic void setMaxLinearSpeed(float maxLinearSpeed)
LimitersetMaxLinearSpeed in interface Limiterpublic float getMaxLinearAcceleration()
LimitergetMaxLinearAcceleration in interface Limiterpublic void setMaxLinearAcceleration(float maxLinearAcceleration)
LimitersetMaxLinearAcceleration in interface Limiterpublic float getMaxAngularSpeed()
LimitergetMaxAngularSpeed in interface Limiterpublic void setMaxAngularSpeed(float maxAngularSpeed)
LimitersetMaxAngularSpeed in interface Limiterpublic float getMaxAngularAcceleration()
LimitergetMaxAngularAcceleration in interface Limiterpublic void setMaxAngularAcceleration(float maxAngularAcceleration)
LimitersetMaxAngularAcceleration in interface Limiterpublic T getPosition()
LocationgetPosition in interface Location<T extends com.badlogic.gdx.math.Vector<T>>public float getOrientation()
LocationgetOrientation in interface Location<T extends com.badlogic.gdx.math.Vector<T>>public void setOrientation(float orientation)
LocationsetOrientation in interface Location<T extends com.badlogic.gdx.math.Vector<T>>orientation - the orientation in radianspublic T getLinearVelocity()
SteerablegetLinearVelocity in interface Steerable<T extends com.badlogic.gdx.math.Vector<T>>public float getAngularVelocity()
SteerablegetAngularVelocity in interface Steerable<T extends com.badlogic.gdx.math.Vector<T>>public float getBoundingRadius()
SteerablegetBoundingRadius in interface Steerable<T extends com.badlogic.gdx.math.Vector<T>>public boolean isTagged()
Steerabletrue if this Steerable is tagged; false otherwise.public void setTagged(boolean tagged)
Steerablepublic Location<T> newLocation()
Location
This method is used internally to instantiate locations of the correct type parameter T. This technique keeps the API
simple and makes the API easier to use with the GWT backend because avoids the use of reflection.
newLocation in interface Location<T extends com.badlogic.gdx.math.Vector<T>>public float vectorToAngle(T vector)
LocationvectorToAngle in interface Location<T extends com.badlogic.gdx.math.Vector<T>>vector - the vectorpublic T angleToVector(T outVector, float angle)
LocationangleToVector in interface Location<T extends com.badlogic.gdx.math.Vector<T>>outVector - the output vector.angle - the angle in radians.