triggerTime is the time in seconds since the beginning of the cinematic when the cinematic event will start
cinematicEvent is the cinematic event.
There are several kind of implemented cinematic events:
PositionTrack : allow you to change the position of a spatial over time. It will move the spatial to destination in a given amount of time by linearly interpolating the position.
RotationTrack : same as position but for rotation
ScaleTrack : same as position and rotation but for scale.
SoundTrack : allow to play a sound at a given time for the given duration
GuiTrack : Displays a nifty gui at a given time for the given duration. To use it you first need to bind the nifty xml to the cinematic like that
cinematic.bindUi(“path/to/nifty/file.xml”);
In the example I created a SubtitleTrack that extends GuiTrack that displays a subtitle in a nifty panel.
AnimationTrack : Allow to start a model animation at a given time (a character walking animation for example)
MotionTrack : Close to PositionTrack, but allow the use of MotionPath for non linear movements.
A motionPath is a list of several waypoints. A path is interpolated using Catmull-rom splines between the waypoints.
The Motion track allow a spatial to move along a MotionPath in a given duration.
There will be more track implemention, but of course, you can make your own CinematicEvent by extending AbstractCinematicEvent.
It implements the CinematicEvent interface and provides duration, time, speed, etc… management.
In the example I demonstrate how to use it for a fadeIn/fadeOut effect in combination with the FadeFilter.
The camera management is handle as follow :
you need to bind the camera to the cinematic like that
nehon said:
the "Screen not found" is thrown by nifty. It's just a warning
To close the screen i just call nifty.gotoScreen(""); the screen "" does not exists indeed, but that's intended.
maybe there is a better way to close a screen.
For the second question, maybe i should implement some kind of listener so you could restore back the camera control when the cinematic is finished.
Ok , yes i'm pretty sure you should do it because after a cinematics in game we want the camera back to have the game continuing , thanks a lot for everything !
nehon said:
re-organize your imports, for sound track and motion track look at the new constructors, you should find what you need
Can you be more specific ? i updated everything and i still have thoses errors
(i download the last nightly build , then i replace everything in Programfiles>JmonkeyPlateform>Jmonkeyplateform>libs , i'm not sure that it's the right thing to do i'm using Eclipse .
nehon said:
I added support for CinematicEventListener on CinematicEvents
In that listener you have a onPlay, onPause, onStop method
You just have to add one to you cinematic
I have another question , if i want to have an order of some Waypoint ( for example i’m filming an object by his left side , then by his right side but without any interpolation , just a changing plan like in cinema ) , is that possible to have something like this :
[java]
cinematic.addCinematicEvent(X,leftSide()); // with leftside a cameramotion with some waypoint and X the frame number
danath said:
Is that possible to change the duration only between 2 path ?
What do you mean...? you mean between 2 waypoints?
If that's what you want you should try to play with the speed attribute.
Look at the TestCameraMotionPath, i showed how to use a MotionPathListener, that triggers an event each time the target reaches a waypoint. The motionTrack and the index of the waypoint are passed so you can increase speed at a certain waipoint and decrease back at the next waypoint.
Thank you i’ll try that tonight ! About speed and time feature , what will happen if the game is on a low configuration ? Will the speed and time reduce to let the cinematic loading ? or does the cinematic will be offbeat ?
The cinematics are made to not be frame rate dependent, but if the hardware cannot display it at an interactive frame rate…there will be slowdowns…like in the actual game.
We discussed once with Normen a way to save the cinematic to video…maybe we’ll add this feature, but that will be a JMP feature, not really a JME3 feature.
nehon said:
?
There is no loading it's real time...
The cinematics are made to not be frame rate dependent, but if the hardware cannot display it at an interactive frame rate...there will be slowdowns...like in the actual game.
We discussed once with Normen a way to save the cinematic to video...maybe we'll add this feature, but that will be a JMP feature, not really a JME3 feature.
The problem here is that a lot of people doesn't have good computer and i think that if cinematics are not frame rate based that would be a problem with a lot of offbeat , i saw a tpf variable , doesn't this var synchronised with the cpu on simpleupdate ? ( still new on JME sorry if my question is absolutely wrong )
How do they do in most game if the computer doesn't specify to the game ? are they doing real time too ?