com.jme3.application
provides a toolset for jME3 applications
to interact with various components of the engine. Typically, the
{@link com.jme3.app.Application} class will be extended and the update() method
implemented to provide functionality for the main loop.
An Application
will typically provide the following services:
public class ExampleUse extends Application {
private Node rootNode = new Node("Root Node");
public static void main(String[] args){
ExampleUse app = new ExampleUse();
app.start();
}
@Override
public void initialize(){
super.initialize();
// attach root node to viewport
viewPort.attachScene(rootNode);
}
@Override
public void update(){
super.update();
float tpf = timer.getTimePerFrame();
// update rootNode
rootNode.updateLogicalState(tpf);
rootNode.updateGeometricState();
// render the viewports
renderManager.render(tpf);
}
}