Package com.jme3.cinematic.events
Class AnimEvent
java.lang.Object
com.jme3.cinematic.events.AbstractCinematicEvent
com.jme3.cinematic.events.AnimEvent
- All Implemented Interfaces:
CinematicEvent,Savable
A CinematicEvent that plays a canned animation action in an
AnimComposer.
Inspired by Nehon's AnimationEvent.-
Field Summary
FieldsFields inherited from class com.jme3.cinematic.events.AbstractCinematicEvent
initialDuration, listeners, loopMode, playState, resuming, speed, time -
Constructor Summary
ConstructorsModifierConstructorDescriptionprotectedNo-argument constructor needed by SavableClassUtil.AnimEvent(AnimComposer composer, String actionName, String layerName) Instantiate a non-looping event to play the named action on the named layer of the specified AnimComposer. -
Method Summary
Modifier and TypeMethodDescriptionvoidinitEvent(Application app, Cinematic cinematic) Initialize this event.voidonPause()Callback when the event is paused.voidonPlay()Callback when the event is started.voidonStop()Callback when the event is stopped.voidonUpdate(float tpf) Callback on each render pass while the event is playing.voidread(JmeImporter importer) De-serialize this event from the specified importer, for example when loading from a J3O file.voidsetSpeed(float speed) Alter the speed of the animation.voidsetTime(float time) Jump to the specified time.voidwrite(JmeExporter exporter) Serialize this event to the specified exporter, for example when saving to a J3O file.Methods inherited from class com.jme3.cinematic.events.AbstractCinematicEvent
addListener, dispose, forceStop, getDuration, getInitialDuration, getLoopMode, getPlayState, getSpeed, getTime, internalUpdate, pause, play, removeListener, setInitialDuration, setLoopMode, stop
-
Field Details
-
logger
-
-
Constructor Details
-
AnimEvent
Instantiate a non-looping event to play the named action on the named layer of the specified AnimComposer.- Parameters:
composer- the Control that will play the animation (not null)actionName- the name of the animation action to be playedlayerName- the name of the animation layer on which the action will be played
-
AnimEvent
protected AnimEvent()No-argument constructor needed by SavableClassUtil.
-
-
Method Details
-
initEvent
Initialize this event. (for internal use)- Specified by:
initEventin interfaceCinematicEvent- Overrides:
initEventin classAbstractCinematicEvent- Parameters:
app- the Application that contains this eventcinematic- the Cinematic that contains this event
-
onPause
public void onPause()Callback when the event is paused.- Specified by:
onPausein classAbstractCinematicEvent
-
onPlay
public void onPlay()Callback when the event is started.- Specified by:
onPlayin classAbstractCinematicEvent
-
onStop
public void onStop()Callback when the event is stopped.- Specified by:
onStopin classAbstractCinematicEvent
-
onUpdate
public void onUpdate(float tpf) Callback on each render pass while the event is playing.- Specified by:
onUpdatein classAbstractCinematicEvent- Parameters:
tpf- time per frame (in seconds)
-
read
De-serialize this event from the specified importer, for example when loading from a J3O file.- Specified by:
readin interfaceSavable- Overrides:
readin classAbstractCinematicEvent- Parameters:
importer- (not null)- Throws:
IOException- from the importer
-
setSpeed
public void setSpeed(float speed) Alter the speed of the animation.- Specified by:
setSpeedin interfaceCinematicEvent- Overrides:
setSpeedin classAbstractCinematicEvent- Parameters:
speed- the relative speed (default=1)
-
setTime
public void setTime(float time) Jump to the specified time.- Specified by:
setTimein interfaceCinematicEvent- Overrides:
setTimein classAbstractCinematicEvent- Parameters:
time- the desired time (in seconds, time=0 is the start of the event)
-
write
Serialize this event to the specified exporter, for example when saving to a J3O file.- Specified by:
writein interfaceSavable- Overrides:
writein classAbstractCinematicEvent- Parameters:
exporter- (not null)- Throws:
IOException- from the exporter
-