Example #1
0
  /**
   * Updates the sky box textures with a bitmap array of length 6.
   *
   * @param bitmaps {@link Bitmap} array containing the cube map textures. The sequence of the
   *     bitmaps in array should be front, right, back, left, up, down, the same as in
   *     setSkybox(Bitmap[] bitmaps)
   * @throws Exception
   */
  public void updateSkybox(Bitmap[] bitmaps) throws Exception {
    if (mSkyboxTexture.getClass() != CubeMapTexture.class)
      throw new Exception("The skybox texture cannot be updated. It is not a cube map texture.");

    CubeMapTexture cubemap = (CubeMapTexture) mSkyboxTexture;
    cubemap.setBitmaps(bitmaps);
    mRenderer.getTextureManager().replaceTexture(cubemap);
  }
Example #2
0
  /**
   * Updates the sky box textures with a single texture.
   *
   * @param resourceId int the resource id of the new texture.
   * @throws Exception
   */
  public void updateSkybox(int resourceId) throws Exception {
    if (mSkyboxTexture.getClass() != Texture.class)
      throw new Exception("The skybox texture cannot be updated.");

    Texture texture = (Texture) mSkyboxTexture;
    texture.setResourceId(resourceId);
    mRenderer.getTextureManager().replaceTexture(texture);
  }
Example #3
0
  /**
   * Updates the sky box textures with 6 new resource ids.
   *
   * @param front int Resource id for the front face.
   * @param right int Resource id for the right face.
   * @param back int Resource id for the back face.
   * @param left int Resource id for the left face.
   * @param up int Resource id for the up face.
   * @param down int Resource id for the down face.
   * @throws Exception
   */
  public void updateSkybox(int front, int right, int back, int left, int up, int down)
      throws Exception {
    if (mSkyboxTexture.getClass() != CubeMapTexture.class)
      throw new Exception("The skybox texture cannot be updated. It is not a cube map texture.");

    int[] resourceIds = new int[] {front, right, back, left, up, down};

    CubeMapTexture cubemap = (CubeMapTexture) mSkyboxTexture;
    cubemap.setResourceIds(resourceIds);
    mRenderer.getTextureManager().replaceTexture(cubemap);
  }