|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||
java.lang.Objectcom.threerings.opengl.effect.PositionHistory
public final class PositionHistory
Stores all of the positions occupied by a particle up to a maximum interval and provides a means of retrieving an interpolated historical position.
| Nested Class Summary | |
|---|---|
protected static class |
PositionHistory.Entry
An entry in the history. |
| Field Summary | |
|---|---|
protected ArrayList<PositionHistory.Entry> |
_entries
The entries in the history. |
protected float |
_length
The current length. |
protected ArrayList<PositionHistory.Entry> |
_pool
The pool of entries to reuse. |
protected float |
_time
The last time value recorded. |
protected Transform3D |
_transform
The transform to apply to new entries. |
| Constructor Summary | |
|---|---|
PositionHistory()
|
|
| Method Summary | |
|---|---|
protected void |
addEntry(Vector3f position,
float time)
Adds an entry for the specified values, fetching one from the pool if possible. |
Vector3f |
get(float t,
Vector3f result)
Computes the position at some point in the past. |
void |
init(Vector3f initial,
Transform3D transform)
(Re)initializes the history. |
void |
record(Vector3f position,
float elapsed,
float length)
Records a position occupied by the particle. |
| Methods inherited from class java.lang.Object |
|---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Field Detail |
|---|
protected float _time
protected float _length
protected Transform3D _transform
protected ArrayList<PositionHistory.Entry> _entries
protected ArrayList<PositionHistory.Entry> _pool
| Constructor Detail |
|---|
public PositionHistory()
| Method Detail |
|---|
public void init(Vector3f initial,
Transform3D transform)
initial - the initial position.transform - the transform to apply to new entries, or null for none.
public void record(Vector3f position,
float elapsed,
float length)
public Vector3f get(float t,
Vector3f result)
t - the time parameter: zero for the oldest location, one for the newest.
protected void addEntry(Vector3f position,
float time)
|
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | ||||||||