|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object net.nexttext.behaviour.AbstractAction net.nexttext.behaviour.physics.PhysicsAction net.nexttext.behaviour.physics.Approach
public class Approach
Approach applies an acceleration which tries to push the object in the direction of its target.
Nested Class Summary |
---|
Nested classes/interfaces inherited from interface net.nexttext.behaviour.Action |
---|
Action.ActionResult |
Constructor Summary | |
---|---|
Approach(float x,
float y)
Constructor creates a Approach at x,y with a default speed and hitRange. |
|
Approach(float x,
float y,
float z)
Constructor creates a Approach at x,y,z with a default speed and hitRange. |
|
Approach(float x,
float y,
float z,
float speed,
int hitRange)
Constructor creates a Approach at x,y,z. |
|
Approach(float x,
float y,
float speed,
int hitRange)
Constructor creates a Approach at x,y. |
|
Approach(Locatable target)
Creates an Approach action at a certain target with default speed of 10 and hitRange or 2. |
|
Approach(Locatable target,
float speed,
int hitRange)
|
|
Approach(Locatable target,
float speed,
int hitRange,
boolean canComplete)
|
Method Summary | |
---|---|
Action.ActionResult |
behave(TextObject to)
Applies an acceleration towards the target, with a magnitude proportional to the Speed property. |
void |
setTarget(float x,
float y)
Sets a target to approach. |
void |
setTarget(float x,
float y,
float z)
Sets a target to approach. |
void |
setTarget(Locatable target)
Sets a target to approach. |
void |
setTarget(processing.core.PVector target)
Sets a target to approach. |
Methods inherited from class net.nexttext.behaviour.physics.PhysicsAction |
---|
applyAcceleration, applyAngularAcceleration, applyAngularForce, applyForce, getAngularVelocity, getMass, getRequiredProperties, getVelocity |
Methods inherited from class net.nexttext.behaviour.AbstractAction |
---|
behave, behave, complete, getDisplayName, makeBehaviour, properties, setDisplayName |
Methods inherited from class java.lang.Object |
---|
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Methods inherited from interface net.nexttext.behaviour.Action |
---|
behave, behave, complete, getRequiredProperties |
Constructor Detail |
---|
public Approach(Locatable target, float speed, int hitRange)
speed
- controls the magnitude of the acceleration applied in the direction
of the targethitRange
- this value is used as a radius around the target to
determine if Approach has reached its location. A hitRange of 1 means
that Approach will not return done unless the object is right on target.public Approach(Locatable target, float speed, int hitRange, boolean canComplete)
canComplete
- indicates whether this action should ever complete.
If set to false, then textObjects will stop moving once they enter the hitRange,
but will start moving again if the object to be followed moves out of the hitRange.public Approach(Locatable target)
target
- public Approach(float x, float y, float speed, int hitRange)
x
- y
- speed
- hitRange
- public Approach(float x, float y)
x
- y
- public Approach(float x, float y, float z)
x
- y
- z
- public Approach(float x, float y, float z, float speed, int hitRange)
x
- y
- z
- speed
- hitRange
- Method Detail |
---|
public Action.ActionResult behave(TextObject to)
Result is complete if it has reached its target.
behave
in interface Action
behave
in class AbstractAction
public void setTarget(float x, float y)
setTarget
in interface TargetingAction
public void setTarget(float x, float y, float z)
setTarget
in interface TargetingAction
public void setTarget(processing.core.PVector target)
setTarget
in interface TargetingAction
public void setTarget(Locatable target)
setTarget
in interface TargetingAction
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |