Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- package mygame;
- import com.jme3.app.SimpleApplication;
- import com.jme3.math.ColorRGBA;
- import com.jme3.math.Vector3f;
- import com.jme3.renderer.RenderManager;
- import com.jme3.scene.Node;
- import com.jme3.system.AppSettings;
- public class Main extends SimpleApplication
- {
- static boolean orbitSelection = false; //set if mouse is to be used to select on screen items
- public static OrbitCamera orbit = null;
- public static Node sceneNode, modelNode, worldNode, camNode;
- public static void main(String[] args)
- {
- AppSettings settings = new AppSettings(true);
- settings.setResolution(720, 480);
- settings.setFullscreen(false);
- Main app = new Main();
- app.setShowSettings(false);
- app.setSettings(settings);
- app.start();
- }
- @Override
- public void simpleInitApp()
- {
- //setup scene nodes
- /**
- * rootNode
- * |
- * -------------------------------------
- * | | |
- * camNode UINode sceneNode
- * | | | |
- * camera UI elements worldNode modelNode
- * | |
- * xyz axis sketch planes
- * | |
- * xyz planes sketches
- *
- */
- camNode = new Node(); //node used to control cam
- rootNode.attachChild(camNode);
- sceneNode = new Node(); //parent node to world and model nodes
- worldNode = new Node(); //node containing xyz axis and planes
- modelNode = new Node(); //parent node to all sketch planes
- sceneNode.attachChild(worldNode);
- sceneNode.attachChild(modelNode);
- rootNode.attachChild(sceneNode);
- Canvas.setRootAndManager(assetManager, worldNode);
- Canvas.createXYZAxis();
- Canvas.createXYZPlanes();
- Canvas.createDragArrows(guiNode); //was gui node
- viewPort.setBackgroundColor(ColorRGBA.White);
- //setup scene camera
- flyCam.setEnabled(false);
- orbit = new OrbitCamera(new Vector3f(0,0,0), cam,camNode, inputManager);
- //set default location of camera
- orbit.moveCamera(0.39324224f, -5.1840777f);
- //start controls, mouse/keyboard
- Controls con = new Controls(inputManager, rootNode, guiNode);
- con.setupKeys();
- }
- @Override
- public void simpleUpdate(float tpf)
- {
- }
- @Override
- public void simpleRender(RenderManager rm)
- {
- //TODO: add render code
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement