Class Skybox


  • public class Skybox
    extends Object
    Class that represents a skybox
    Author:
    Darius Dinger
    • Constructor Detail

      • Skybox

        public Skybox()
        Creating new skybox, init variables
    • Method Detail

      • setRotation

        public void setRotation​(float rotation)
        Parameters:
        rotation - New rotation of the skybox in degrees
      • getSkyboxFbo

        public FrameBufferObject getSkyboxFbo()
        Fbo that stores the rendered skybox. Can be used f.e. to fade fog into the skybox.
        Returns:
        Skybox fbo
      • setCubeMapTextures

        public void setCubeMapTextures​(String[] cubeMapTextures,
                                       float[] blendingFactors)
        Setting cube map textures and its initial blending factors.
        The factor represents the visibility of the cube map texture. 0.0f is not visible and 1.0f is full visible. The blending factor will be multiplied by the texture color.
        The cubeMapTextures must have the same length as the blendingfactors, else it would not be changed.
        Parameters:
        cubeMapTextures - Cube map textures
        blendingFactors - Initial blending factors
      • setCubeMapTexture

        public void setCubeMapTexture​(int id,
                                      String tex)
        Setting cube map texture at specific id. The id has to be in the range of the units else it wouldnt change!
        Parameters:
        id - Id of the unit to set the texture
        tex - TextureData to set at the id
      • setBlendingFactor

        public void setBlendingFactor​(int id,
                                      float blending)
        Setting blending factor at specific id. The id has to be in the range of the units else it wouldnt change!
        The factor represents the visibility of the cube map texture. 0.0f is not visible and 1.0f is full visible. The blending factor will be multiplied by the texture color.
        Parameters:
        id - Id of the unit to set the blending factor for
        blending - Blending factor to set at the id
      • addCubeMapTexture

        public int addCubeMapTexture​(String tex,
                                     float blending)
        Adding cube map texture and its initial blending factor to the units.
        The factor represents the visibility of the cube map texture. 0.0f is not visible and 1.0f is full visible. The blending factor will be multiplied by the texture color.
        Parameters:
        tex - Cube map texture to add
        blending - Initial blending factor
        Returns:
        Unit id of the texture
      • getBlendingFactors

        public float[] getBlendingFactors()
        Returns:
        Read/writeable array of the blending factors
      • getCubeMapTextures

        public String[] getCubeMapTextures()
        Returns:
        Read/writeable array of the cube map textures
      • getTransMat

        public javax.vecmath.Matrix4f getTransMat()
        Returns:
        Current transformation matrix of the skybox