/** * A convenience method for auto-setting the frame based on a world position the user desires the camera to look at. * It points the camera towards the given position using the difference between that position and the current camera * location as a direction vector and the general worldUpVector to compute up and left camera vectors. * * @param pos * where to look at in terms of world coordinates * @param worldUpVector * a normalized vector indicating the up direction of the world. (often {@link Vector3#UNIT_Y} or * {@link Vector3#UNIT_Z}) */ public void lookAt(final ReadOnlyVector3 pos, final ReadOnlyVector3 worldUpVector) { lookAt(pos.getX(), pos.getY(), pos.getZ(), worldUpVector); }
/** * A convenience method for auto-setting the frame based on a world position the user desires the camera to look at. * It points the camera towards the given position using the difference between that position and the current camera * location as a direction vector and the general worldUpVector to compute up and left camera vectors. * * @param pos * where to look at in terms of world coordinates * @param worldUpVector * a normalized vector indicating the up direction of the world. (often {@link Vector3#UNIT_Y} or * {@link Vector3#UNIT_Z}) */ public void lookAt(final ReadOnlyVector3 pos, final ReadOnlyVector3 worldUpVector) { lookAt(pos.getX(), pos.getY(), pos.getZ(), worldUpVector); }
private void updateCameraLookat() { _tRenderer.getCamera().setLocation(_cam.getLocation()); _tRenderer.getCamera().lookAt(_center, _worldUpVector); }
private void updateCameraLookat() { _tRenderer.getCamera().setLocation(_cam.getLocation()); _tRenderer.getCamera().lookAt(_center, _worldUpVector); }
/** * Update the position of the Camera controlled by this object. * * @param time * a delta time, in seconds. Not used currently, but might be useful for doing "ease-in" of camera * movements. */ public void update(final double time) { updateTargetPos(); if (!_dirty) { return; } if (_worldUpVec.getY() == 1) { MathUtils.sphericalToCartesian(_sphereCoords, _camPosition); } else if (_worldUpVec.getZ() == 1) { MathUtils.sphericalToCartesianZ(_sphereCoords, _camPosition); } _camera.setLocation(_camPosition.addLocal(_lookAtPoint)); _camera.lookAt(_lookAtPoint, _worldUpVec); _dirty = false; }
/** * Update the position of the Camera controlled by this object. * * @param time * a delta time, in seconds. Not used currently, but might be useful for doing "ease-in" of camera * movements. */ public void update(final double time) { updateTargetPos(); if (!_dirty) { return; } if (_worldUpVec.getY() == 1) { MathUtils.sphericalToCartesian(_sphereCoords, _camPosition); } else if (_worldUpVec.getZ() == 1) { MathUtils.sphericalToCartesianZ(_sphereCoords, _camPosition); } if (_camera != null) { _camera.setLocation(_camPosition.addLocal(_lookAtPoint)); _camera.lookAt(_lookAtPoint, _worldUpVec); } _dirty = false; }
shadowCam.lookAt(center, Vector3.UNIT_Y);
shadowCam.lookAt(center, Vector3.UNIT_Y);
projectorCamera.lookAt(planeIntersection, Vector3.UNIT_Y);
projectorCamera.lookAt(planeIntersection, Vector3.UNIT_Y);