public void setupCamera() { flyCam.setEnabled(false); }
@Override public void setEnabled(boolean enabled) { super.setEnabled(enabled); flyCam.setEnabled(enabled); }
private void setupChaseCamera() { flyCam.setEnabled(false); chaseCam = new ChaseCamera(cam, model, inputManager); }
@Override public void simpleInitApp() { flyCam.setEnabled(false); // We need the cursor to be visible. If it is not visible the cursor // will still be "used" and loaded, you just won't see it on the screen. inputManager.setCursorVisible(true); /* * To make jME3 use a custom cursor it is as simple as putting the * .cur/.ico/.ani file in an asset directory. Here we use * "Textures/GUI/Cursors". * * For the purpose of this demonstration we load 3 different cursors and add them * into an array list and switch cursor every 8 seconds. * * The first ico has been made by Sirea and the set can be found here: * http://www.rw-designer.com/icon-set/nyan-cat * * The second cursor has been made by Virum64 and is Public Domain. * http://www.rw-designer.com/cursor-set/memes-faces-v64 * * The animated cursor has been made by Pointer Adic and can be found here: * http://www.rw-designer.com/cursor-set/monkey */ cursors.add((JmeCursor) assetManager.loadAsset("Textures/Cursors/meme.cur")); cursors.add((JmeCursor) assetManager.loadAsset("Textures/Cursors/nyancat.ico")); cursors.add((JmeCursor) assetManager.loadAsset("Textures/Cursors/monkey.ani")); sysTime = System.currentTimeMillis(); inputManager.setMouseCursor(cursors.get(count)); }
public void simpleInitApp() { NiftyJmeDisplay niftyDisplay = new NiftyJmeDisplay(assetManager, inputManager, audioRenderer, guiViewPort); nifty = niftyDisplay.getNifty(); nifty.fromXml("all/intro.xml", "start"); // attach the nifty display to the gui view port as a processor guiViewPort.addProcessor(niftyDisplay); // disable the fly cam flyCam.setEnabled(false); }
guiNode.attachChild(txt1); flyCam.setEnabled(false); inputManager.setCursorVisible(true);
@Override public void simpleInitApp() { clContext = null; NiftyJmeDisplay niftyDisplay = NiftyJmeDisplay.newNiftyJmeDisplay( assetManager, inputManager, audioRenderer, guiViewPort); nifty = niftyDisplay.getNifty(); nifty.fromXml("jme3test/opencl/ContextSwitchingScreen.xml", "Screen", this); guiViewPort.addProcessor(niftyDisplay); inputManager.setCursorVisible(true); flyCam.setEnabled(false); }
/** * Initializes game */ @Override public void simpleInitApp() { Logger.getLogger("com.jme3").setLevel(Level.WARNING); flyCam.setEnabled(false); setDisplayStatView(false); Keys(); defaultFont = assetManager.loadFont("Interface/Fonts/Default.fnt"); pressStart = new BitmapText(defaultFont, false); fpsScoreText = new BitmapText(defaultFont, false); loadText(fpsScoreText, "Current Score: 0", defaultFont, 0, 2, 0); loadText(pressStart, "PRESS ENTER", defaultFont, 0, 5, 0); player = createPlayer(); rootNode.attachChild(player); cubeField = new ArrayList<Geometry>(); obstacleColors = new ArrayList<ColorRGBA>(); gameReset(); } /**
guiNode.attachChild(txt1); flyCam.setEnabled(false); inputManager.setCursorVisible(true);
@Override public void simpleInitApp() { flyCam.setEnabled(false);
@Override public void simpleInitApp() { flyCam.setEnabled(false); initMark(); // a red sphere to mark the hit /** create four colored boxes and a floor to shoot at: */ shootables = new Node("Shootables"); rootNode.attachChild(shootables); shootables.attachChild(makeCube("a Dragon", -2f, 0f, 1f)); shootables.attachChild(makeCube("a tin can", 1f, -2f, 0f)); shootables.attachChild(makeCube("the Sheriff", 0f, 1f, -2f)); shootables.attachChild(makeCube("the Deputy", 1f, 0f, -4f)); shootables.attachChild(makeFloor()); shootables.attachChild(makeCharacter()); }
private void buildPlayer() { spaceCraft = assetManager.loadModel("Models/HoverTank/Tank2.mesh.xml"); CollisionShape colShape = CollisionShapeFactory.createDynamicMeshShape(spaceCraft); spaceCraft.setShadowMode(ShadowMode.CastAndReceive); spaceCraft.setLocalTranslation(new Vector3f(-140, 50, -23)); spaceCraft.setLocalRotation(new Quaternion(new float[]{0, 0.01f, 0})); hoverControl = new PhysicsHoverControl(colShape, 500); spaceCraft.addControl(hoverControl); rootNode.attachChild(spaceCraft); getPhysicsSpace().add(hoverControl); hoverControl.setCollisionGroup(PhysicsCollisionObject.COLLISION_GROUP_02); ChaseCamera chaseCam = new ChaseCamera(cam, inputManager); spaceCraft.addControl(chaseCam); flyCam.setEnabled(false); }
@Override public void simpleInitApp() { viewPort.setBackgroundColor(ColorRGBA.DarkGray); flyCam.setEnabled(false);
@Override public void simpleInitApp() { flyCam.setEnabled(false); BulletAppState bulletAppState = new BulletAppState(); bulletAppState.setDebugEnabled(true); bulletAppState.setSpeed(0f); stateManager.attach(bulletAppState); PhysicsSpace space = bulletAppState.getPhysicsSpace(); float radius = 1f; CollisionShape sphere = new SphereCollisionShape(radius); CollisionShape box = new BoxCollisionShape(Vector3f.UNIT_XYZ); RigidBodyControl rbc = new RigidBodyControl(box); rbc.setEnabled(false); rbc.setPhysicsSpace(space); rootNode.addControl(rbc); BetterCharacterControl bcc = new BetterCharacterControl(radius, 4f, 1f); bcc.setEnabled(false); bcc.setPhysicsSpace(space); rootNode.addControl(bcc); GhostControl gc = new GhostControl(sphere); gc.setEnabled(false); gc.setPhysicsSpace(space); rootNode.addControl(gc); } }
@Override public void simpleInitApp() { initOpenCL1(); tex = new Texture2D(settings.getWidth(), settings.getHeight(), 1, com.jme3.texture.Image.Format.RGBA8); Picture pic = new Picture("julia"); pic.setTexture(assetManager, tex, true); pic.setPosition(0, 0); pic.setWidth(settings.getWidth()); pic.setHeight(settings.getHeight()); guiNode.attachChild(pic); initCounter = 0; flyCam.setEnabled(false); inputManager.setCursorVisible(true); inputManager.addMapping("right", new MouseAxisTrigger(MouseInput.AXIS_X, false)); inputManager.addMapping("left", new MouseAxisTrigger(MouseInput.AXIS_X, true)); inputManager.addMapping("up", new MouseAxisTrigger(MouseInput.AXIS_Y, false)); inputManager.addMapping("down", new MouseAxisTrigger(MouseInput.AXIS_Y, true)); inputManager.addMapping("drag", new MouseButtonTrigger(MouseInput.BUTTON_LEFT)); inputManager.addListener(this, "right", "left", "up", "down", "drag"); dragging = false; }
@Override public void simpleInitApp() { // activate physics bulletAppState = new BulletAppState(); stateManager.attach(bulletAppState); // init a physical test scene PhysicsTestHelper.createPhysicsTestWorldSoccer(rootNode, assetManager, bulletAppState.getPhysicsSpace()); setupKeys(); // Add a physics character to the world physicsCharacter = new CharacterControl(new CapsuleCollisionShape(0.5f, 1.8f), .1f); physicsCharacter.setPhysicsLocation(new Vector3f(0, 1, 0)); characterNode = new Node("character node"); Spatial model = assetManager.loadModel("Models/Sinbad/Sinbad.mesh.xml"); model.scale(0.25f); characterNode.addControl(physicsCharacter); getPhysicsSpace().add(physicsCharacter); rootNode.attachChild(characterNode); characterNode.attachChild(model); // set forward camera node that follows the character camNode = new CameraNode("CamNode", cam); camNode.setControlDir(ControlDirection.SpatialToCamera); camNode.setLocalTranslation(new Vector3f(0, 1, -5)); camNode.lookAt(model.getLocalTranslation(), Vector3f.UNIT_Y); characterNode.attachChild(camNode); //disable the default 1st-person flyCam (don't forget this!!) flyCam.setEnabled(false); }
@Override public void simpleInitApp() { flyCam.setEnabled(false); Geometry blueBox = new Geometry("blue box", mesh); Material blueMat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); blueMat.setColor("Color", ColorRGBA.Blue); blueBox.setMaterial(blueMat); rootNode.attachChild(blueBox); rightCam = cam.clone(); rightCam.setViewPort(0.5f, 1f, 0f, 1f); rightView = renderManager.createMainView("right", rightCam); rightView.setClearFlags(true, true, true); rightView.setEnabled(false); rightView.attachScene(rootNode); Geometry redBox = new Geometry("red box", mesh); Material redMat = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); redMat.setColor("Color", ColorRGBA.Red); redBox.setMaterial(redMat); leftScene.attachChild(redBox); leftCam = cam.clone(); leftCam.setViewPort(0f, 0.5f, 0f, 1f); leftView = renderManager.createMainView("left", leftCam); leftView.setClearFlags(true, true, true); leftView.setEnabled(false); leftView.attachScene(leftScene); inputManager.addMapping("lmb", new MouseButtonTrigger(MouseInput.BUTTON_LEFT)); inputManager.addListener(this, "lmb"); }
flyCam.setEnabled(false);
flyCam.setEnabled(false);
Node tank = (Node) assetManager.loadModel("Models/HoverTank/Tank2.mesh.xml"); flyCam.setEnabled(false); ChaseCamera chaseCam = new ChaseCamera(cam, tank, inputManager); chaseCam.setSmoothMotion(true);