Animated Ogre models come as a set of files: when you look at the included Jaime model, the model is in Jaime.mesh.xml
, and the animation details are in Jaime.skeleton.xml
.
Copy the content of the Jaime directory to a new BasicGame's assets/Models/Jaime/
directory. Open the directory in the SDK and use the context menu to convert the mesh.xml
file to .j3o
. Move the Jaime.j3o
file to a new corresponding assets/Models/Jaime directory
.
Your goal is to add the model to the scene, and then animate it when the user presses the Space bar. To trigger the animation, you want to use the familiar input handling that you learned when you were interacting with the user previously.
Make a copy of
LoadModel.java
and name the classAnimateModel.java
. Remember to also refactor the first line of themain()
method to:AnimateModel app = new AnimateModel ();
Create a class field that represents the model. Let's call it
player
. Initialize theplayer
in thesimpleInitApp...