@Override protected void doTask() { // ensure all cameras can see the far side of the skybox float out_radius = (float)skybox.getGeometry().getBoundingSphere().getRadius(); float in_radius = out_radius/(float)Math.sqrt(3); float median_diagonal = in_radius + out_radius; for (int i = 0, j = mCameras.size(); i < j; ++i) if(mCameras.get(i).getFarPlane() < median_diagonal) { mCameras.get(i).setFarPlane(median_diagonal); } } };
cam.setFarPlane(camera.properties.farPlane); cam.setFieldOfView(camera.properties.fieldOfView);
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; } }
mCameraLeft.setFieldOfView(getCurrentCamera().getFieldOfView()); mCameraLeft.setNearPlane(getCurrentCamera().getNearPlane()); mCameraLeft.setFarPlane(getCurrentCamera().getFarPlane()); mCameraRight.setFieldOfView(getCurrentCamera().getFieldOfView()); mCameraRight.setNearPlane(getCurrentCamera().getNearPlane()); mCameraRight.setFarPlane(getCurrentCamera().getFarPlane());
/** * Creates a skybox with the specified single texture. * * @param resourceId int Resouce id of the skybox texture. * @throws TextureException */ public void setSkybox(int resourceId) throws TextureException { synchronized (mCameras) { for (int i = 0, j = mCameras.size(); i < j; ++i) mCameras.get(i).setFarPlane(1000); } synchronized (mNextSkyboxLock) { mNextSkybox = new Cube(700, true, false); mNextSkybox.setDoubleSided(true); mSkyboxTexture = new Texture("skybox", resourceId); Material material = new Material(); material.setColorInfluence(0); material.addTexture(mSkyboxTexture); mNextSkybox.setMaterial(material); } }
cam.setFarPlane(camera.properties.farPlane); cam.setFieldOfView(camera.properties.fieldOfView);
/** * Creates a skybox with the specified 6 textures. * * @param posx int Resource id for the front face. * @param negx int Resource id for the right face. * @param posy int Resource id for the back face. * @param negy int Resource id for the left face. * @param posz int Resource id for the up face. * @param negz int Resource id for the down face. * @throws TextureException */ public void setSkybox(int posx, int negx, int posy, int negy, int posz, int negz) throws TextureException { synchronized (mCameras) { for (int i = 0, j = mCameras.size(); i < j; ++i) mCameras.get(i).setFarPlane(1000); } synchronized (mNextSkyboxLock) { mNextSkybox = new Cube(700, true); int[] resourceIds = new int[]{posx, negx, posy, negy, posz, negz}; mSkyboxTexture = new CubeMapTexture("skybox", resourceIds); ((CubeMapTexture) mSkyboxTexture).isSkyTexture(true); Material mat = new Material(); mat.setColorInfluence(0); mat.addTexture(mSkyboxTexture); mNextSkybox.setMaterial(mat); } }
/** * Creates a skybox with the specified 6 {@link Bitmap} textures. * * @param bitmaps {@link Bitmap} array containing the cube map textures. */ public void setSkybox(Bitmap[] bitmaps) { synchronized (mCameras) { for (int i = 0, j = mCameras.size(); i < j; ++i) mCameras.get(i).setFarPlane(1000); } final Cube skybox = new Cube(700, true); final CubeMapTexture texture = new CubeMapTexture("bitmap_skybox", bitmaps); texture.isSkyTexture(true); final Material material = new Material(); material.setColorInfluence(0); try { material.addTexture(texture); } catch (TextureException e) { RajLog.e(e.getMessage()); } skybox.setMaterial(material); synchronized (mNextCameraLock) { mNextSkybox = skybox; } }
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; } }
mCameraLeft.setFieldOfView(getCurrentCamera().getFieldOfView()); mCameraLeft.setNearPlane(getCurrentCamera().getNearPlane()); mCameraLeft.setFarPlane(getCurrentCamera().getFarPlane()); mCameraRight.setFieldOfView(getCurrentCamera().getFieldOfView()); mCameraRight.setNearPlane(getCurrentCamera().getNearPlane()); mCameraRight.setFarPlane(getCurrentCamera().getFarPlane());