@ThreadSafe public abstract class TrajectoryDriver extends TrajectoryActor
Base class for drivers of Joint sub-transform trajectories.
Copyright (C) 2008 Marsette A. Vona, III
| Modifier and Type | Field and Description |
|---|---|
private static java.lang.String |
cvsid |
protected double |
lastUpdateTime
TrajectoryActor.clock timestamp of last update() since activation or
NaN if none. |
active, clock, joint, slackID, wasOnlySetChangedGoalComponents, xform, xformID| Constructor and Description |
|---|
TrajectoryDriver()
Makes a new trajectory driver using a default
Clock (wall-clock
time). |
TrajectoryDriver(vona.time.Clock clock)
makes a new trajectory driver
|
| Modifier and Type | Method and Description |
|---|---|
void |
activate()
extends superclass impl to un-set
lastUpdateTime |
protected boolean |
compareXFormsInNeedsUpdate()
Whether to
TrajectoryActor.compareXFormsToModel() in needsUpdate(). |
void |
deactivate()
extends superclass impl to un-set
lastUpdateTime |
protected double |
getMinUpdateTime()
Get the minimum time in
TrajectoryActor.clock time between calls to needsUpdate() which return true. |
boolean |
needsUpdate()
Called by the update thread when this TrajectoryActor is active to
check whether
TrajectoryActor.update() needs to be called soon. |
void |
update()
Read/write transform state from/to model.
|
protected abstract void |
updateXForms()
Update the
TrajectoryActor.xform values from their driving source. |
protected boolean |
updateXFormsInNeedsUpdate()
|
bind, checkBindings, clampXForms, compareXFormsToModel, getBoundJoint, getBoundXForm, getConstrainedInterpolationType, getDefaultXForm, getNumBindings, getOriginalUnsetGoal, getUnconstrainedInterpolationType, isActive, modelStateChanged, modelStructureChanged, onlySetChangedGoalComponents, readXFormsFromModel, unbind, writeXFormsToModelprivate static final java.lang.String cvsid
protected double lastUpdateTime
TrajectoryActor.clock timestamp of last update() since activation or
NaN if none.
public TrajectoryDriver(vona.time.Clock clock)
public TrajectoryDriver()
Makes a new trajectory driver using a default Clock (wall-clock
time).
public void activate()
lastUpdateTimeactivate in class TrajectoryActorpublic void deactivate()
lastUpdateTimedeactivate in class TrajectoryActorpublic void update()
Read/write transform state from/to model.
This is called automatically by the update thread whenever this TrajectoryActor is active. See class header doc for details.
This impl sets lastUpdateTime, updateXForms(), and then
TrajectoryActor.writeXFormsToModel().
update in class TrajectoryActorpublic boolean needsUpdate()
Called by the update thread when this TrajectoryActor is active to
check whether TrajectoryActor.update() needs to be called soon.
This impl does updateXForms() then returns the opposite of
TrajectoryActor.compareXFormsToModel() iff lastUpdateTime is NaN or is
at least as long ago as getMinUpdateTime().
The comparison is skipped if not compareXFormsInNeedsUpdate(),
and otherwise the update is skipped if not updateXFormsInNeedsUpdate().
needsUpdate in class TrajectoryActorprotected boolean compareXFormsInNeedsUpdate()
Whether to TrajectoryActor.compareXFormsToModel() in needsUpdate().
Default impl returns true.
protected boolean updateXFormsInNeedsUpdate()
Whether to updateXForms() before TrajectoryActor.compareXFormsToModel()
in needsUpdate().
This is all only if compareXFormsInNeedsUpdate() is true.
Default impl returns true.
protected double getMinUpdateTime()
Get the minimum time in TrajectoryActor.clock time between calls to needsUpdate() which return true.
Default impl returns 0.
protected abstract void updateXForms()
Update the TrajectoryActor.xform values from their driving source.