/** * Updates the projection matrix of the current camera for new view port dimensions. * * @param width int the new viewport width in pixels. * @param height in the new viewport height in pixes. */ public void updateProjectionMatrix(int width, int height) { mCamera.setProjectionMatrix(width, height); }
public void setProjectionMatrix(double fieldOfView, int width, int height) { synchronized (mFrustumLock) { mFieldOfView = fieldOfView; setProjectionMatrix(width, height); } }
public void setFarPlane(double farPlane) { synchronized (mFrustumLock) { mFarPlane = farPlane; mCameraDirty = true; setProjectionMatrix(mLastWidth, mLastHeight); } }
public void setFieldOfView(double fieldOfView) { synchronized (mFrustumLock) { mFieldOfView = fieldOfView; mCameraDirty = true; setProjectionMatrix(mLastWidth, mLastHeight); } }
public void setNearPlane(double nearPlane) { synchronized (mFrustumLock) { mNearPlane = nearPlane; mCameraDirty = true; setProjectionMatrix(mLastWidth, mLastHeight); } }
@Override public void setProjectionMatrix(int width, int height) { super.setProjectionMatrix(width, height); }
/** * Switches the {@link Scene} currently being displayed. It resets the * OpenGL state and sets the projection matrix for the new scene. * <p/> * This method should only be called from the main OpenGL render thread * ({@link Renderer#onRender(long, double)}). Calling this outside of the main thread * may case unexpected behaviour. * * @param nextScene {@link Scene} The scene to switch to. */ public void switchSceneDirect(Scene nextScene) { mCurrentScene = nextScene; mCurrentScene.markLightingDirty(); // Make sure the lighting is updated for the new scene mCurrentScene.resetGLState(); // Ensure that the GL state is what this scene expects final int wViewport = mOverrideViewportWidth > -1 ? mOverrideViewportWidth : mDefaultViewportWidth; final int hViewport = mOverrideViewportHeight > -1 ? mOverrideViewportHeight : mDefaultViewportHeight; mCurrentScene.getCamera().setProjectionMatrix(wViewport, hViewport); }
@Override protected void onRender(final long elapsedTime, final double deltaTime) { mUserScene = getCurrentScene(); setRenderTarget(mLeftRenderTarget); getCurrentScene().switchCamera(mCameraLeft); GLES20.glViewport(0, 0, mViewportWidthHalf, mDefaultViewportHeight); mCameraLeft.setProjectionMatrix(mViewportWidthHalf, mDefaultViewportHeight); mCameraLeft.setOrientation(mCameraOrientation); render(elapsedTime, deltaTime); setRenderTarget(mRightRenderTarget); getCurrentScene().switchCamera(mCameraRight); mCameraRight.setProjectionMatrix(mViewportWidthHalf, mDefaultViewportHeight); mCameraRight.setOrientation(mCameraOrientation); render(elapsedTime, deltaTime); switchSceneDirect(mSideBySideScene); GLES20.glViewport(0, 0, mDefaultViewportWidth, mDefaultViewportHeight); setRenderTarget(null); render(elapsedTime, deltaTime); switchSceneDirect(mUserScene); }
public Camera clone() { Camera cam = new Camera(); cam.setFarPlane(mFarPlane); cam.setFieldOfView(mFieldOfView); cam.setGraphNode(mGraphNode, mInsideGraph); cam.setLookAt(mLookAt.clone()); cam.setNearPlane(mNearPlane); cam.setOrientation(mOrientation.clone()); cam.setPosition(mPosition.clone()); cam.setProjectionMatrix(mLastWidth, mLastHeight); return cam; } }
mCamera.setProjectionMatrix(mRenderer.getViewportWidth(), mRenderer.getViewportHeight()); mNextCamera = null;
public void updateFrustum() { mCamera.setProjectionMatrix(mRenderer.getOverrideViewportWidth(), mRenderer.getOverrideViewportHeight()); if (mPoints == null) { if (!mCamera.isInitialized()) {
mRightRenderTarget.setFullscreen(false); mCameraLeft.setProjectionMatrix(mViewportWidthHalf, mDefaultViewportHeight); mCameraRight.setProjectionMatrix(mViewportWidthHalf, mDefaultViewportHeight);
public void setProjectionMatrix(double fieldOfView, int width, int height) { synchronized (mFrustumLock) { mFieldOfView = fieldOfView; setProjectionMatrix(width, height); } }
public void setFarPlane(double farPlane) { synchronized (mFrustumLock) { mFarPlane = farPlane; mCameraDirty = true; setProjectionMatrix(mLastWidth, mLastHeight); } }
public void setFieldOfView(double fieldOfView) { synchronized (mFrustumLock) { mFieldOfView = fieldOfView; mCameraDirty = true; setProjectionMatrix(mLastWidth, mLastHeight); } }
/** * Updates the projection matrix of the current camera for new view port dimensions. * * @param width int the new viewport width in pixels. * @param height in the new viewport height in pixes. */ public void updateProjectionMatrix(int width, int height) { mCamera.setProjectionMatrix(width, height); }
public void setNearPlane(double nearPlane) { synchronized (mFrustumLock) { mNearPlane = nearPlane; mCameraDirty = true; setProjectionMatrix(mLastWidth, mLastHeight); } }
@Override public void setProjectionMatrix(int width, int height) { super.setProjectionMatrix(width, height); }
/** * Switches the {@link RajawaliScene} currently being displayed. It resets the * OpenGL state and sets the projection matrix for the new scene. * <p/> * This method should only be called from the main OpenGL render thread * ({@link RajawaliRenderer#onRender(long, double)}). Calling this outside of the main thread * may case unexpected behaviour. * * @param nextScene {@link RajawaliScene} The scene to switch to. */ public void switchSceneDirect(RajawaliScene nextScene) { mCurrentScene = nextScene; mCurrentScene.markLightingDirty(); // Make sure the lighting is updated for the new scene mCurrentScene.resetGLState(); // Ensure that the GL state is what this scene expects mCurrentScene.getCamera().setProjectionMatrix(mOverrideViewportWidth, mOverrideViewportHeight); }
public Camera clone() { Camera cam = new Camera(); cam.setFarPlane(mFarPlane); cam.setFieldOfView(mFieldOfView); cam.setGraphNode(mGraphNode, mInsideGraph); cam.setLookAt(mLookAt.clone()); cam.setNearPlane(mNearPlane); cam.setOrientation(mOrientation.clone()); cam.setPosition(mPosition.clone()); cam.setProjectionMatrix(mLastWidth, mLastHeight); return cam; } }