Hello.
I was studding tutorial, and HelloAnimation.java file.
I modify this file to have only one Box which is rotating.
And it works correctly, but when I copy and paste this to file where I have BaseGame it doesn't work
Here is my file from SimpleGame:
public class test extends SimpleGame {
public static void main(String[] args) {
test app = new test();
app.setDialogBehaviour(AbstractGame.ALWAYS_SHOW_PROPS_DIALOG);
app.start();
}
protected void simpleInitGame()
{
// I create a box and attach it too my lightnode. This lets me see where my light is
Box b2=new Box("Blarg2",new Vector3f(-.5f,-.5f,-20.5f),new Vector3f(.5f,.5f,-19.5f));
b2.setModelBound(new BoundingBox());
b2.updateModelBound();
rootNode.attachChild(b2);
// I create a controller to rotate my pivot
SpatialTransformer st=new SpatialTransformer(1);
// I tell my spatial controller to change pivot
st.setObject(b2,0,-1);
// Assign a rotation for object 0 at time 0 to rotate 0 degrees around the z axis
Quaternion x0=new Quaternion();
x0.fromAngleAxis(0,new Vector3f(0,0,1));
st.setRotation(0,0,x0);
// Assign a rotation for object 0 at time 2 to rotate 180 degrees around the z axis
Quaternion x180=new Quaternion();
x180.fromAngleAxis(FastMath.DEG_TO_RAD*180,new Vector3f(0,0,1));
st.setRotation(0,4,x180);
// Prepare my controller to start moving around
//st.interpolateMissing();
// Tell my pivot it is controlled by st
b2.addController(st);
rootNode.attachChild(b2);
}
}
this same code I was trying to put in "initGame()", after i run app I see my box, but it doesn't rotate like in first example.
Thanks in advice for any help.