/** * Creates a new FlyByCamera to control the specified camera. * * @param cam camera to be controlled (not null) */ public FlyByCamera(Camera cam){ this.cam = cam; initialUpVec = cam.getUp().clone(); }
/** * Constructs the chase camera * if you use this constructor you have to attach the cam later to a spatial * doing spatial.addControl(chaseCamera); * @param cam the application camera */ public ChaseCamera(Camera cam) { this.cam = cam; initialUpVec = cam.getUp().clone(); }
@Override protected void updateShadowCams(Camera viewCam) { if (light == null) { logger.warning("The light can't be null for a " + getClass().getName()); return; } float zFar = zFarOverride; if (zFar == 0) { zFar = viewCam.getFrustumFar(); } //We prevent computing the frustum points and splits with zeroed or negative near clip value float frustumNear = Math.max(viewCam.getFrustumNear(), 0.001f); ShadowUtil.updateFrustumPoints(viewCam, frustumNear, zFar, 1.0f, points); //shadowCam.setDirection(direction); shadowCam.setFrustumPerspective(light.getSpotOuterAngle() * FastMath.RAD_TO_DEG * 2.0f, 1, 1f, light.getSpotRange()); shadowCam.getRotation().lookAt(light.getDirection(), shadowCam.getUp()); shadowCam.setLocation(light.getPosition()); shadowCam.update(); shadowCam.updateViewProjection(); }
shadowCam.getRotation().lookAt(light.getDirection(), shadowCam.getUp()); shadowCam.update(); shadowCam.updateViewProjection();
FloatBuffer texcoords = (FloatBuffer) tvb.getData(); Vector3f camUp = cam.getUp(); Vector3f camLeft = cam.getLeft(); Vector3f camDir = cam.getDirection();
public void setCamera(Camera cam, Matrix4f viewMatrix, Matrix4f projMatrix, Matrix4f viewProjMatrix) { this.viewMatrix.set(viewMatrix); this.projMatrix.set(projMatrix); this.viewProjMatrix.set(viewProjMatrix); camLoc.set(cam.getLocation()); cam.getLeft(camLeft); cam.getUp(camUp); cam.getDirection(camDir); near = cam.getFrustumNear(); far = cam.getFrustumFar(); }
shadowCam.getRotation().lookAt(light.getDirection(), shadowCam.getUp()); shadowCam.update(); shadowCam.updateViewProjection();
@Override public void initialize(AppStateManager stateManager, Application app) { super.initialize(stateManager, app); this.inputManager = app.getInputManager(); target = new Node("ChaseCamTarget"); camNode.setCamera(app.getCamera()); camNode.setControlDir(CameraControl.ControlDirection.SpatialToCamera); target.attachChild(camNode); camNode.setLocalTranslation(0, 0, distance); upVector = app.getCamera().getUp().clone(); leftVector = app.getCamera().getLeft().clone(); registerWithInput(); rotateCamera(); }
mat.fromAngleNormalAxis(rotationSpeed * value, axis); Vector3f up = cam.getUp(); Vector3f left = cam.getLeft(); Vector3f dir = cam.getDirection();
/** * Rotate the billboard so it points directly opposite the direction the * camera's facing * * @param camera * Camera */ private void rotateScreenAligned(Camera camera) { // coopt diff for our in direction: look.set(camera.getDirection()).negateLocal(); // coopt loc for our left direction: left.set(camera.getLeft()).negateLocal(); orient.fromAxes(left, camera.getUp(), look); Node parent = spatial.getParent(); Quaternion rot=new Quaternion().fromRotationMatrix(orient); if ( parent != null ) { rot = parent.getWorldRotation().inverse().multLocal(rot); rot.normalizeLocal(); } spatial.setLocalRotation(rot); fixRefreshFlags(); }
shadowCam.getRotation().lookAt(direction, shadowCam.getUp()); shadowCam.update(); shadowCam.updateViewProjection();
reflectDirection.subtractLocal(camLoc); sceneTarget.set(sceneCam.getLocation()).subtractLocal(sceneCam.getUp(vars.vect6)); reflectUp = plane.reflect(sceneTarget, reflectUp); reflectUp.subtractLocal(camLoc);
Vector3f up = getUp(vars.vect3);
Vector3f up = viewCam.getUp();
/** * Constructs the chase camera * if you use this constructor you have to attach the cam later to a spatial * doing spatial.addControl(chaseCamera); * @param cam the application camera */ public ChaseCamera(Camera cam) { this.cam = cam; initialUpVec = cam.getUp().clone(); }
/** * Constructs the chase camera * if you use this constructor you have to attach the cam later to a spatial * doing spatial.addControl(chaseCamera); * @param cam the application camera */ public ChaseCamera(Camera cam) { this.cam = cam; initialUpVec = cam.getUp().clone(); }
/** * Constructs the chase camera * if you use this constructor you have to attach the cam later to a spatial * doing spatial.addControl(chaseCamera); * @param cam the application camera */ public CustomChaseCamera(Camera cam) { this.cam = cam; initialUpVec = cam.getUp().clone(); }
public void setCamera(Camera cam, Matrix4f viewMatrix, Matrix4f projMatrix, Matrix4f viewProjMatrix) { this.viewMatrix.set(viewMatrix); this.projMatrix.set(projMatrix); this.viewProjMatrix.set(viewProjMatrix); camLoc.set(cam.getLocation()); cam.getLeft(camLeft); cam.getUp(camUp); cam.getDirection(camDir); near = cam.getFrustumNear(); far = cam.getFrustumFar(); }