Package com.jme3.util

Class SkyFactory

java.lang.Object
com.jme3.util.SkyFactory

public class SkyFactory extends Object
SkyFactory is used to create jME Spatials that can be attached to the scene to display a sky image in the background.
  • Method Details

    • createSky

      @Deprecated public static Spatial createSky(AssetManager assetManager, Texture texture, Vector3f normalScale, boolean sphereMap)
      Create a sky with radius=10 using the given cubemap or spheremap texture. For the sky to be visible, its radius must fall between the near and far planes of the camera's frustum.
      Parameters:
      assetManager - from which to load materials
      texture - to use
      normalScale - The normal scale is multiplied by the 3D normal to get a texture coordinate. Use Vector3f.UNIT_XYZ to not apply and transformation to the normal.
      sphereMap - determines how the texture is used:
      • true: The texture is a Texture2D with the pixels arranged for sphere mapping.
      • false: The texture is either a TextureCubeMap or Texture2D. If it is a Texture2D then the image is taken from it and is inserted into a TextureCubeMap
      Returns:
      a new spatial representing the sky, ready to be attached to the scene graph
    • createSky

      public static Spatial createSky(AssetManager assetManager, Texture texture, Vector3f normalScale, SkyFactory.EnvMapType envMapType)
      Create a sky with radius=10 using the given cubemap or spheremap texture. For the sky to be visible, its radius must fall between the near and far planes of the camera's frustum.
      Parameters:
      assetManager - from which to load materials
      texture - to use
      normalScale - The normal scale is multiplied by the 3D normal to get a texture coordinate. Use Vector3f.UNIT_XYZ to not apply and transformation to the normal.
      envMapType - see SkyFactory.EnvMapType
      Returns:
      a new spatial representing the sky, ready to be attached to the scene graph
    • createSky

      @Deprecated public static Spatial createSky(AssetManager assetManager, Texture texture, Vector3f normalScale, boolean sphereMap, int sphereRadius)
      Create a sky using the given cubemap or spheremap texture.
      Parameters:
      assetManager - from which to load materials
      texture - to use
      normalScale - The normal scale is multiplied by the 3D normal to get a texture coordinate. Use Vector3f.UNIT_XYZ to not apply and transformation to the normal.
      sphereMap - determines how the texture is used:
      • true: The texture is a Texture2D with the pixels arranged for sphere mapping.
      • false: The texture is either a TextureCubeMap or Texture2D. If it is a Texture2D then the image is taken from it and is inserted into a TextureCubeMap
      sphereRadius - the sky sphere's radius: for the sky to be visible, its radius must fall between the near and far planes of the camera's frustum
      Returns:
      a new spatial representing the sky, ready to be attached to the scene graph
    • createSky

      public static Spatial createSky(AssetManager assetManager, Texture texture, Vector3f normalScale, SkyFactory.EnvMapType envMapType, float sphereRadius)
      Create a sky using the given cubemap or spheremap texture.
      Parameters:
      assetManager - from which to load materials
      texture - to use
      normalScale - The normal scale is multiplied by the 3D normal to get a texture coordinate. Use Vector3f.UNIT_XYZ to not apply and transformation to the normal.
      envMapType - see SkyFactory.EnvMapType
      sphereRadius - the sky sphere's radius: for the sky to be visible, its radius must fall between the near and far planes of the camera's frustum
      Returns:
      a new spatial representing the sky, ready to be attached to the scene graph
    • createSky

      @Deprecated public static Spatial createSky(AssetManager assetManager, Texture texture, boolean sphereMap)
      Create a sky using the given cubemap or spheremap texture.
      Parameters:
      assetManager - from which to load materials
      texture - to use
      sphereMap - determines how the texture is used:
      • true: The texture is a Texture2D with the pixels arranged for sphere mapping.
      • false: The texture is either a TextureCubeMap or Texture2D. If it is a Texture2D then the image is taken from it and is inserted into a TextureCubeMap
      Returns:
      a new spatial representing the sky, ready to be attached to the scene graph
    • createSky

      @Deprecated public static Spatial createSky(AssetManager assetManager, String textureName, boolean sphereMap)
      Create a sky using the given cubemap or spheremap texture.
      Parameters:
      assetManager - from which to load materials
      textureName - the path to the texture asset to use
      sphereMap - determines how the texture is used:
      • true: The texture is a Texture2D with the pixels arranged for sphere mapping.
      • false: The texture is either a TextureCubeMap or Texture2D. If it is a Texture2D then the image is taken from it and is inserted into a TextureCubeMap
      Returns:
      a new spatial representing the sky, ready to be attached to the scene graph
    • createSky

      public static Spatial createSky(AssetManager assetManager, Texture texture, SkyFactory.EnvMapType envMapType)
      Create a sky using the given cubemap or spheremap texture.
      Parameters:
      assetManager - from which to load materials
      texture - to use
      envMapType - see SkyFactory.EnvMapType
      Returns:
      a new spatial representing the sky, ready to be attached to the scene graph
    • createSky

      public static Spatial createSky(AssetManager assetManager, String textureName, SkyFactory.EnvMapType envMapType)
      Create a sky using the given cubemap or spheremap texture.
      Parameters:
      assetManager - from which to load materials
      textureName - the path to the texture asset to use
      envMapType - see SkyFactory.EnvMapType
      Returns:
      a new spatial representing the sky, ready to be attached to the scene graph
    • createSky

      public static Spatial createSky(AssetManager assetManager, Texture west, Texture east, Texture north, Texture south, Texture up, Texture down, Vector3f normalScale)
      Create a cube-mapped sky with radius=10 using six textures. For the sky to be visible, its radius must fall between the near and far planes of the camera's frustum.
      Parameters:
      assetManager - from which to load materials
      west - texture for the western face of the cube
      east - texture for the eastern face of the cube
      north - texture for the northern face of the cube
      south - texture for the southern face of the cube
      up - texture for the top face of the cube
      down - texture for the bottom face of the cube
      normalScale - The normal scale is multiplied by the 3D normal to get a texture coordinate. Use Vector3f.UNIT_XYZ to not apply and transformation to the normal.
      Returns:
      a new spatial representing the sky, ready to be attached to the scene graph
    • createSky

      public static Spatial createSky(AssetManager assetManager, Texture west, Texture east, Texture north, Texture south, Texture up, Texture down, Vector3f normalScale, float sphereRadius)
      Create a cube-mapped sky using six textures.
      Parameters:
      assetManager - from which to load materials
      west - texture for the western face of the cube
      east - texture for the eastern face of the cube
      north - texture for the northern face of the cube
      south - texture for the southern face of the cube
      up - texture for the top face of the cube
      down - texture for the bottom face of the cube
      normalScale - The normal scale is multiplied by the 3D normal to get a texture coordinate. Use Vector3f.UNIT_XYZ to not apply and transformation to the normal.
      sphereRadius - the sky sphere's radius: for the sky to be visible, its radius must fall between the near and far planes of the camera's frustum
      Returns:
      a new spatial representing the sky, ready to be attached to the scene graph
    • createSky

      public static Spatial createSky(AssetManager assetManager, Texture west, Texture east, Texture north, Texture south, Texture up, Texture down)
      Create a cube-mapped sky using six textures.
      Parameters:
      assetManager - from which to load materials
      west - texture for the western face of the cube
      east - texture for the eastern face of the cube
      north - texture for the northern face of the cube
      south - texture for the southern face of the cube
      up - texture for the top face of the cube
      down - texture for the bottom face of the cube
      Returns:
      a new spatial representing the sky, ready to be attached to the scene graph