All Downloads are FREE. Search and download functionalities are using the official Maven repository.

com.jme3.app.package.html Maven / Gradle / Ivy

The newest version!









The 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:

  • {@link com.jme3.asset.AssetManager} - A system for finding and loading data assets included with the application, such as models and textures.
  • {@link com.jme3.renderer.RenderManager} - A high-level rendering interface for 3D graphics, manages viewports and scenes assigned to the viewports, as well as general high-level rendering.
  • {@link com.jme3.input.InputManager} - An interface for handling input from devices such as keyboard, mouse, and gamepad/joystick.
  • {@link com.jme3.app.state.AppStateManager} - Manager for {@link com.jme3.app.state.AppState}s, which are specific application functionality to be executed inside the main loop.
  • {@link com.jme3.audio.AudioRenderer} - Allows playing sound effects and music.
  • {@link com.jme3.system.Timer} - The timer keeps track of time and allows computing the time since the last frame (TPF) that is neccessary for framerate-independent updates and motion.
  • {@link com.jme3.system.AppSettings} - A database containing various settings for the application. These settings may be set by the user or the application itself.

Usage

An example use of the Application class is as follows

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);
}
}





© 2015 - 2024 Weber Informatics LLC | Privacy Policy