I’ve been going through the tutorials and have been successful so far. However, I have no idea why the simpleUpdate function in the 4th tutorial doesn’t work. The function doesn’t seem to even run. While the visuals work and I can move the camera, the cube doesn’t rotate.
The code:
[java]
package jme3test.helloworld;
import com.jme3.app.SimpleApplication;
import com.jme3.material.Material;
import com.jme3.math.ColorRGBA;
import com.jme3.math.Quaternion;
import com.jme3.math.Vector3f;
import com.jme3.scene.Geometry;
import com.jme3.scene.shape.Box;
public class HelloLoop extends SimpleApplication{
public static void main(String[] args){
HelloLoop app = new HelloLoop();
app.start();
}
protected Geometry player;
@Override
public void simpleInitApp(){
Box b = new Box(Vector3f.ZERO, 1.0f, 1.0f, 1.0f);
player = new Geometry(“blue cube”, b);
Material mat = new Material(assetManager,
“Common/MatDefs/Misc/Unshaded.j3md”);
mat.setColor(“Color”, ColorRGBA.Blue);
player.setMaterial(mat);
rootNode.attachChild(player);
}
@Override
public void simpleUpdate(float tpf){
player.rotate(0, 2*tpf, 0);
}
}
[/java]
I’ve copied the tutorials code directly (it didn’t work) and searched google for similar problems with no success.
Edit: I apologize for making a stupid mistake and posting it. I had made a new package and didn’t delete the existing package. Anyway, the solution was to delete the other package.
To be exact: the solution was setting the main class of the project to the correct new class, you only provoked the auto-detection of main classes by deleting the other one, leaving just the new one to start.