net.nexttext.behaviour.physics
Class Move
java.lang.Object
net.nexttext.behaviour.AbstractAction
net.nexttext.behaviour.physics.PhysicsAction
net.nexttext.behaviour.physics.Move
- All Implemented Interfaces:
- Action
public class Move
- extends PhysicsAction
This is the basic Move; actions from the physics package will have no effect
unless this behaviour is applied to objects.
It implements basic mechanics, updating position and velocity, rotation,
and angular velocity, based on force, angular force (torque), and mass. On
each frame the force and angular force are reset to zero. In addition, each
Move has its own drag coefficient, which is applied to every object's
velocity on each frame.
Physics actions will typically add to the force on an object on each
frame.
Constructor Summary |
Move()
|
Move(float drag,
float angularDrag)
New Move action with specified drag. |
Methods inherited from class java.lang.Object |
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Move
public Move()
Move
public Move(float drag,
float angularDrag)
- New Move action with specified drag.
Drag is a fraction of the velocity by which it will be scaled back.
So a drag of 1 will cause objects to halt completely, and 0 will have no
effect.
behave
public Action.ActionResult behave(TextObject to)
- Applies Euler motion to a TextObject.
- Specified by:
behave
in interface Action
- Overrides:
behave
in class AbstractAction