|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectcom.jme3.cinematic.events.AbstractCinematicEvent
public abstract class AbstractCinematicEvent
This calls contains basic behavior of a cinematic event every cinematic event must extend this class A cinematic event must be given an inital duration in seconds (duration of the event at speed = 1) (default is 10)
Field Summary | |
---|---|
protected float |
initialDuration
|
protected java.util.List<CinematicEventListener> |
listeners
the list of listeners |
protected LoopMode |
loopMode
|
protected PlayState |
playState
|
protected boolean |
resuming
|
protected float |
speed
|
protected float |
time
|
Constructor Summary | |
---|---|
AbstractCinematicEvent()
contruct a cinematic event |
|
AbstractCinematicEvent(float initialDuration)
contruct a cinematic event wwith the given initial duration |
|
AbstractCinematicEvent(float initialDuration,
LoopMode loopMode)
contruct a cinematic event with the given loopMode and the given initialDuration |
|
AbstractCinematicEvent(LoopMode loopMode)
contruct a cinematic event with the given loopMode |
Method Summary | |
---|---|
void |
addListener(CinematicEventListener listener)
Add a CinematicEventListener to this event |
float |
getDuration()
returns the actual duration of the animtion (initialDuration/speed) |
float |
getInitialDuration()
returns the initial duration of the animation at speed = 1 in seconds. |
LoopMode |
getLoopMode()
retursthe loopMode of the animation |
PlayState |
getPlayState()
Returns the current playstate of the animation |
float |
getSpeed()
returns the speed of the animation. |
float |
getTime()
returns the current time of the cinematic event |
void |
initEvent(Application app,
Cinematic cinematic)
initialize this event (should be called internally only) |
void |
internalUpdate(float tpf)
should be used internally only |
abstract void |
onPause()
place here the code you want to execute when the event is paused |
protected abstract void |
onPlay()
Place here the code you want to execute when the event is started |
protected abstract void |
onStop()
Place here the code you want to execute when the event is stoped. |
protected abstract void |
onUpdate(float tpf)
Place here the code you want to execute on update (only called when the event is playing) |
void |
pause()
pause this event |
void |
play()
Play this event |
void |
read(JmeImporter im)
for serialization only |
void |
removeListener(CinematicEventListener listener)
remove a CinematicEventListener from this event |
void |
setInitialDuration(float initialDuration)
Sets the duration of the antionamtion at speed = 1 in seconds |
void |
setLoopMode(LoopMode loopMode)
Sets the loopMode of the animation |
void |
setSpeed(float speed)
Sets the speed of the animation. |
void |
setTime(float time)
When this method is invoked, the event should fast forward to the given time according tim 0 is the start of the event. |
void |
stop()
stops the animation, next time play() is called the animation will start from the begining. |
void |
write(JmeExporter ex)
for serialization only |
Methods inherited from class java.lang.Object |
---|
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
---|
protected PlayState playState
protected float speed
protected float initialDuration
protected LoopMode loopMode
protected float time
protected boolean resuming
protected java.util.List<CinematicEventListener> listeners
Constructor Detail |
---|
public AbstractCinematicEvent()
public AbstractCinematicEvent(float initialDuration)
initialDuration
- public AbstractCinematicEvent(LoopMode loopMode)
loopMode
- public AbstractCinematicEvent(float initialDuration, LoopMode loopMode)
initialDuration
- the duration of the event at speed = 1loopMode
- the loop mode of the eventMethod Detail |
---|
public void play()
play
in interface CinematicEvent
protected abstract void onPlay()
public void internalUpdate(float tpf)
internalUpdate
in interface CinematicEvent
tpf
- time per frameprotected abstract void onUpdate(float tpf)
tpf
- time per framepublic void stop()
stop
in interface CinematicEvent
protected abstract void onStop()
public void pause()
pause
in interface CinematicEvent
public abstract void onPause()
public float getDuration()
getDuration
in interface CinematicEvent
public void setSpeed(float speed)
setSpeed
in interface CinematicEvent
speed
- public float getSpeed()
getSpeed
in interface CinematicEvent
public PlayState getPlayState()
getPlayState
in interface CinematicEvent
public float getInitialDuration()
getInitialDuration
in interface CinematicEvent
public void setInitialDuration(float initialDuration)
setInitialDuration
in interface CinematicEvent
initialDuration
- public LoopMode getLoopMode()
getLoopMode
in interface CinematicEvent
LoopMode
public void setLoopMode(LoopMode loopMode)
setLoopMode
in interface CinematicEvent
loopMode
- LoopMode
public void write(JmeExporter ex) throws java.io.IOException
write
in interface Savable
ex
- exporter
java.io.IOException
public void read(JmeImporter im) throws java.io.IOException
read
in interface Savable
im
- importer
java.io.IOException
public void initEvent(Application app, Cinematic cinematic)
initEvent
in interface CinematicEvent
app
- cinematic
- public void addListener(CinematicEventListener listener)
listener
- CinematicEventListenerpublic void removeListener(CinematicEventListener listener)
listener
- CinematicEventListenerpublic void setTime(float time)
setTime
in interface CinematicEvent
time
- the time to fast forward topublic float getTime()
CinematicEvent
getTime
in interface CinematicEvent
|
||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |