com.jme3.cinematic
Class Cinematic

java.lang.Object
  extended by com.jme3.cinematic.events.AbstractCinematicEvent
      extended by com.jme3.cinematic.Cinematic
All Implemented Interfaces:
AppState, CinematicEvent, Savable

public class Cinematic
extends AbstractCinematicEvent
implements AppState


Field Summary
protected  TimeLine timeLine
           
 
Fields inherited from class com.jme3.cinematic.events.AbstractCinematicEvent
initialDuration, listeners, loopMode, playState, resuming, speed, time
 
Constructor Summary
Cinematic()
           
Cinematic(Node scene)
           
Cinematic(Node scene, float initialDuration)
           
Cinematic(Node scene, float initialDuration, LoopMode loopMode)
           
Cinematic(Node scene, LoopMode loopMode)
           
 
Method Summary
 void activateCamera(float timeStamp, java.lang.String cameraName)
           
 KeyFrame addCinematicEvent(float timeStamp, CinematicEvent cinematicEvent)
           
 CameraNode bindCamera(java.lang.String cameraName, Camera cam)
           
 void cleanup()
          Cleanup the game state.
 void fitDuration()
          fits the duration of the cinamatic to the duration of all its child cinematic events
 CameraNode getCamera(java.lang.String cameraName)
           
 java.lang.Object getEventData(java.lang.String type, java.lang.String name)
           
 Node getScene()
           
 void initialize(AppStateManager stateManager, Application app)
          Called to initialize the AppState.
 boolean isEnabled()
           
 boolean isInitialized()
           
 void onPause()
          place here the code you want to execute when the event is paused
 void onPlay()
          Place here the code you want to execute when the event is started
 void onStop()
          Place here the code you want to execute when the event is stoped.
 void onUpdate(float tpf)
          Place here the code you want to execute on update (only called when the event is playing)
 void postRender()
          Called after all rendering commands are flushed.
 void putEventData(java.lang.String type, java.lang.String name, java.lang.Object object)
           
 void read(JmeImporter im)
          for serialization only
 Savable removeEventData(java.lang.String type, java.lang.String name)
           
 void render(RenderManager rm)
          Render the state.
 void setActiveCamera(java.lang.String cameraName)
           
 void setEnabled(boolean enabled)
          Enable or disable the functionality of the AppState.
 void setScene(Node scene)
           
 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 stateAttached(AppStateManager stateManager)
          Called when the state was attached.
 void stateDetached(AppStateManager stateManager)
          Called when the state was detached.
 void update(float tpf)
          Called to update the state.
 void write(JmeExporter ex)
          for serialization only
 
Methods inherited from class com.jme3.cinematic.events.AbstractCinematicEvent
addListener, getDuration, getInitialDuration, getLoopMode, getPlayState, getSpeed, getTime, initEvent, internalUpdate, pause, play, removeListener, setInitialDuration, setLoopMode, stop
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

timeLine

protected TimeLine timeLine
Constructor Detail

Cinematic

public Cinematic()

Cinematic

public Cinematic(Node scene)

Cinematic

public Cinematic(Node scene,
                 float initialDuration)

Cinematic

public Cinematic(Node scene,
                 LoopMode loopMode)

Cinematic

public Cinematic(Node scene,
                 float initialDuration,
                 LoopMode loopMode)
Method Detail

onPlay

public void onPlay()
Description copied from class: AbstractCinematicEvent
Place here the code you want to execute when the event is started

Specified by:
onPlay in class AbstractCinematicEvent

onStop

public void onStop()
Description copied from class: AbstractCinematicEvent
Place here the code you want to execute when the event is stoped.

Specified by:
onStop in class AbstractCinematicEvent

onPause

public void onPause()
Description copied from class: AbstractCinematicEvent
place here the code you want to execute when the event is paused

Specified by:
onPause in class AbstractCinematicEvent

write

public void write(JmeExporter ex)
           throws java.io.IOException
Description copied from class: AbstractCinematicEvent
for serialization only

Specified by:
write in interface Savable
Overrides:
write in class AbstractCinematicEvent
Parameters:
ex - exporter
Throws:
java.io.IOException

read

public void read(JmeImporter im)
          throws java.io.IOException
Description copied from class: AbstractCinematicEvent
for serialization only

Specified by:
read in interface Savable
Overrides:
read in class AbstractCinematicEvent
Parameters:
im - importer
Throws:
java.io.IOException

setSpeed

public void setSpeed(float speed)
Description copied from class: AbstractCinematicEvent
Sets the speed of the animation. At speed = 1, the animation will last initialDuration seconds, At speed = 2 the animation will last initialDuraiton/2...

Specified by:
setSpeed in interface CinematicEvent
Overrides:
setSpeed in class AbstractCinematicEvent

initialize

public void initialize(AppStateManager stateManager,
                       Application app)
Description copied from interface: AppState
Called to initialize the AppState.

Specified by:
initialize in interface AppState
Parameters:
stateManager - The state manager

isInitialized

public boolean isInitialized()
Specified by:
isInitialized in interface AppState
Returns:
True if initialize() was called on the state, false otherwise.

setEnabled

public void setEnabled(boolean enabled)
Description copied from interface: AppState
Enable or disable the functionality of the AppState. The effect of this call depends on implementation. An AppState starts as being enabled by default.

Specified by:
setEnabled in interface AppState
Parameters:
enabled - activate the AppState or not.

isEnabled

public boolean isEnabled()
Specified by:
isEnabled in interface AppState
Returns:
True if the AppState is enabled, false otherwise.
See Also:
AppState.setEnabled(boolean)

stateAttached

public void stateAttached(AppStateManager stateManager)
Description copied from interface: AppState
Called when the state was attached.

Specified by:
stateAttached in interface AppState
Parameters:
stateManager - State manager to which the state was attached to.

stateDetached

public void stateDetached(AppStateManager stateManager)
Description copied from interface: AppState
Called when the state was detached.

Specified by:
stateDetached in interface AppState
Parameters:
stateManager - The state manager from which the state was detached from.

update

public void update(float tpf)
Description copied from interface: AppState
Called to update the state.

Specified by:
update in interface AppState
Parameters:
tpf - Time per frame.

onUpdate

public void onUpdate(float tpf)
Description copied from class: AbstractCinematicEvent
Place here the code you want to execute on update (only called when the event is playing)

Specified by:
onUpdate in class AbstractCinematicEvent
Parameters:
tpf - time per frame

setTime

public void setTime(float time)
Description copied from class: AbstractCinematicEvent
When this method is invoked, the event should fast forward to the given time according tim 0 is the start of the event.

Specified by:
setTime in interface CinematicEvent
Overrides:
setTime in class AbstractCinematicEvent
Parameters:
time - the time to fast forward to

addCinematicEvent

public KeyFrame addCinematicEvent(float timeStamp,
                                  CinematicEvent cinematicEvent)

render

public void render(RenderManager rm)
Description copied from interface: AppState
Render the state.

Specified by:
render in interface AppState
Parameters:
rm - RenderManager

postRender

public void postRender()
Description copied from interface: AppState
Called after all rendering commands are flushed.

Specified by:
postRender in interface AppState

cleanup

public void cleanup()
Description copied from interface: AppState
Cleanup the game state.

Specified by:
cleanup in interface AppState

fitDuration

public void fitDuration()
fits the duration of the cinamatic to the duration of all its child cinematic events


bindCamera

public CameraNode bindCamera(java.lang.String cameraName,
                             Camera cam)

getCamera

public CameraNode getCamera(java.lang.String cameraName)

setActiveCamera

public void setActiveCamera(java.lang.String cameraName)

activateCamera

public void activateCamera(float timeStamp,
                           java.lang.String cameraName)

setScene

public void setScene(Node scene)

putEventData

public void putEventData(java.lang.String type,
                         java.lang.String name,
                         java.lang.Object object)

getEventData

public java.lang.Object getEventData(java.lang.String type,
                                     java.lang.String name)

removeEventData

public Savable removeEventData(java.lang.String type,
                               java.lang.String name)

getScene

public Node getScene()