/** * <code>updateWorldTransform</code> updates the rotation and translation of this node, and sets the camera's frame * buffer to reflect the current view. */ @Override public void updateWorldTransform(final boolean recurse) { super.updateWorldTransform(recurse); if (_camera != null) { final ReadOnlyVector3 worldTranslation = getWorldTranslation(); final ReadOnlyMatrix3 worldRotation = getWorldRotation(); _camera.setFrame(worldTranslation, worldRotation); } }
/** * Forces rotation and translation of this node to be sync'd with the attached camera. (Assumes the node is in world * space.) */ public void updateFromCamera() { final ReadOnlyVector3 camLeft = _camera.getLeft(); final ReadOnlyVector3 camUp = _camera.getUp(); final ReadOnlyVector3 camDir = _camera.getDirection(); final ReadOnlyVector3 camLoc = _camera.getLocation(); final Matrix3 rotation = Matrix3.fetchTempInstance(); rotation.fromAxes(camLeft, camUp, camDir); setRotation(rotation); setTranslation(camLoc); Matrix3.releaseTempInstance(rotation); }
/** * Forces rotation and translation of this node to be sync'd with the attached camera. (Assumes the node is in world * space.) */ public void updateFromCamera() { final ReadOnlyVector3 camLeft = _camera.getLeft(); final ReadOnlyVector3 camUp = _camera.getUp(); final ReadOnlyVector3 camDir = _camera.getDirection(); final ReadOnlyVector3 camLoc = _camera.getLocation(); final Matrix3 rotation = Matrix3.fetchTempInstance(); rotation.fromAxes(camLeft, camUp, camDir); setRotation(rotation); setTranslation(camLoc); Matrix3.releaseTempInstance(rotation); }
/** * <code>updateWorldTransform</code> updates the rotation and translation of this node, and sets the camera's frame * buffer to reflect the current view. */ @Override public void updateWorldTransform(final boolean recurse) { super.updateWorldTransform(recurse); if (_camera != null) { final ReadOnlyVector3 worldTranslation = getWorldTranslation(); final ReadOnlyMatrix3 worldRotation = getWorldRotation(); _camera.setFrame(worldTranslation, worldRotation); } }