private void parseCameraClipping(Attributes attribs) throws SAXException { if (attribs.getValue("near") != null) { camera.setFrustumNear(SAXUtil.parseFloat(attribs.getValue("near"))); camera.setFrustumFar(SAXUtil.parseFloat(attribs.getValue("far"))); } else { camera.setFrustumNear(SAXUtil.parseFloat(attribs.getValue("nearPlaneDist"))); camera.setFrustumFar(SAXUtil.parseFloat(attribs.getValue("farPlaneDist"))); } }
ShadowUtil.updateFrustumPoints(viewCam, frustumNear, zFar, 1.0f, points); shadowCam.setFrustumFar(zFar); shadowCam.getRotation().lookAt(light.getDirection(), shadowCam.getUp()); shadowCam.update();
app.getCamera().setFrustumFar(fFar); app.getCamera().setFrustumNear(fNear);
cam.setFrustumFar(fFar); cam.setFrustumNear(fNear); dummyCam = cam.clone();
@Override public void simpleInitApp() { viewPort.setBackgroundColor(ColorRGBA.Gray); cam.setLocation(new Vector3f(-5.6310086f, 5.0892987f, -13.000479f)); cam.setRotation(new Quaternion(0.1779095f, 0.20036356f, -0.03702727f, 0.96272093f)); cam.update(); cam.setFrustumFar(300); flyCam.setMoveSpeed(30); rootNode.setCullHint(CullHint.Never); setupLighting(); setupModel(); setupFilters(); }
@Override public void simpleInitApp() { cam.setLocation(new Vector3f(-32.295086f, 54.80136f, 79.59805f)); cam.setRotation(new Quaternion(0.074364014f, 0.92519957f, -0.24794696f, 0.27748522f)); cam.update(); cam.setFrustumFar(300); flyCam.setMoveSpeed(30); rootNode.setCullHint(CullHint.Never); setupBasicShadow(); setupHdr(); setupLighting(); setupSkyBox(); // setupTerrain(); setupFloor(); // setupRobotGuy(); setupSignpost(); }
@Override public void simpleInitApp() { bulletAppState = new BulletAppState(); stateManager.attach(bulletAppState); // bulletAppState.getPhysicsSpace().enableDebug(assetManager); cam.setFrustumFar(150f); flyCam.setMoveSpeed(10); setupKeys(); PhysicsTestHelper.createPhysicsTestWorld(rootNode, assetManager, bulletAppState.getPhysicsSpace()); // setupFloor(); buildPlayer(); DirectionalLight dl = new DirectionalLight(); dl.setDirection(new Vector3f(-0.5f, -1f, -0.3f).normalizeLocal()); rootNode.addLight(dl); dl = new DirectionalLight(); dl.setDirection(new Vector3f(0.5f, -0.1f, 0.3f).normalizeLocal()); // rootNode.addLight(dl); }
@Override public void simpleInitApp() { //set far frustum only so we see the outer world longer cam.setFrustumFar(10000); cam.setLocation(Vector3f.ZERO); debugTools = new DebugTools(assetManager); rootNode.attachChild(debugTools.debugNode); poiMaterial = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); poiMaterial.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg")); poiMesh = new Sphere(16, 16, 1f); ballMaterial = new Material(assetManager, "Common/MatDefs/Misc/Unshaded.j3md"); ballMaterial.setTexture("ColorMap", assetManager.loadTexture("Interface/Logo/Monkey.jpg")); ballMaterial.setColor("Color", ColorRGBA.Red); ballMesh = new Sphere(16, 16, 1.0f); poiHorizonCollisionShape = new MeshCollisionShape(new Sphere(128, 128, poiRadius)); poiCollisionShape = new SphereCollisionShape(1f); ballCollisionShape = new SphereCollisionShape(1f); setupKeys(); setupDisplay(); setupFog(); }
@Override public void simpleInitApp() { bulletAppState = new BulletAppState(); bulletAppState.setThreadingType(BulletAppState.ThreadingType.PARALLEL); // bulletAppState.setEnabled(false); stateManager.attach(bulletAppState); bullet = new Sphere(32, 32, 0.4f, true, false); bullet.setTextureMode(TextureMode.Projected); bulletCollisionShape = new SphereCollisionShape(0.4f); brick = new Box(brickWidth, brickHeight, brickDepth); brick.scaleTextureCoordinates(new Vector2f(1f, .5f)); //bulletAppState.getPhysicsSpace().enableDebug(assetManager); initMaterial(); initTower(); initFloor(); initCrossHairs(); this.cam.setLocation(new Vector3f(0, 25f, 8f)); cam.lookAt(Vector3f.ZERO, new Vector3f(0, 1, 0)); cam.setFrustumFar(80); inputManager.addMapping("shoot", new MouseButtonTrigger(MouseInput.BUTTON_LEFT)); inputManager.addListener(actionListener, "shoot"); rootNode.setShadowMode(ShadowMode.Off); }
@Override public void simpleInitApp() { bulletAppState = new BulletAppState(); bulletAppState.setThreadingType(BulletAppState.ThreadingType.PARALLEL); stateManager.attach(bulletAppState); bullet = new Sphere(32, 32, 0.4f, true, false); bullet.setTextureMode(TextureMode.Projected); bulletCollisionShape = new SphereCollisionShape(0.4f); brick = new Box(bLength, bHeight, bWidth); brick.scaleTextureCoordinates(new Vector2f(1f, .5f)); initMaterial(); initWall(); initFloor(); initCrossHairs(); this.cam.setLocation(new Vector3f(0, 6f, 6f)); cam.lookAt(Vector3f.ZERO, new Vector3f(0, 1, 0)); cam.setFrustumFar(15); inputManager.addMapping("shoot", new MouseButtonTrigger(MouseInput.BUTTON_LEFT)); inputManager.addListener(actionListener, "shoot"); inputManager.addMapping("gc", new KeyTrigger(KeyInput.KEY_X)); inputManager.addListener(actionListener, "gc"); rootNode.setShadowMode(ShadowMode.Off); }
leftCamera = origCam; } else if( environment.compositorAllowed() == false ) { origCam.setFrustumFar(100f); origCam.setFrustumNear(1f); leftCamera = origCam.clone();
leftCamera = origCam; } else if( environment.compositorAllowed() == false ) { origCam.setFrustumFar(100f); origCam.setFrustumNear(1f); leftCamera = origCam.clone();
leftCamera = origCam; } else if (environment.compositorAllowed() == false) { origCam.setFrustumFar(100f); origCam.setFrustumNear(1f); leftCamera = origCam.clone();
setupKeys(); this.cam.setFrustumFar(2000);
this.cam.setLocation(new Vector3f(0, 25f, 8f)); cam.lookAt(Vector3f.ZERO, new Vector3f(0, 1, 0)); cam.setFrustumFar(80); inputManager.addMapping("shoot", new MouseButtonTrigger(MouseInput.BUTTON_LEFT)); inputManager.addListener(actionListener, "shoot");
cam.setFrustumFar(3000); cam.setLocation(new Vector3f(-700, 100, 300)); cam.setRotation(new Quaternion().fromAngles(new float[]{FastMath.PI * 0.06f, FastMath.PI * 0.65f, 0}));
viewPort.setBackgroundColor(ColorRGBA.DarkGray); frustumCam = cam.clone(); frustumCam.setFrustumFar(25); makeCamFrustum(); aabb.setCenter(20, 10, -60);