Package com.jme3.util
Class SkyFactory
java.lang.Object
com.jme3.util.SkyFactory
SkyFactory
is used to create jME Spatial
s that can
be attached to the scene to display a sky image in the background.-
Nested Class Summary
Modifier and TypeClassDescriptionstatic enum
The type of map fed to the shader -
Method Summary
Modifier and TypeMethodDescriptionstatic Spatial
createSky
(AssetManager assetManager, Texture texture, boolean sphereMap) Deprecated.static Spatial
createSky
(AssetManager assetManager, Texture texture, Vector3f normalScale, boolean sphereMap) static Spatial
createSky
(AssetManager assetManager, Texture texture, Vector3f normalScale, boolean sphereMap, int sphereRadius) 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.static Spatial
createSky
(AssetManager assetManager, Texture texture, Vector3f normalScale, SkyFactory.EnvMapType envMapType, float sphereRadius) Create a sky using the given cubemap or spheremap texture.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.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.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.static Spatial
createSky
(AssetManager assetManager, Texture texture, SkyFactory.EnvMapType envMapType) Create a sky using the given cubemap or spheremap texture.static Spatial
createSky
(AssetManager assetManager, String textureName, boolean sphereMap) static Spatial
createSky
(AssetManager assetManager, String textureName, SkyFactory.EnvMapType envMapType) Create a sky using the given cubemap or spheremap texture.
-
Method Details
-
createSky
@Deprecated public static Spatial createSky(AssetManager assetManager, Texture texture, Vector3f normalScale, boolean sphereMap) Deprecated.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 materialstexture
- to usenormalScale
- 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 materialstexture
- to usenormalScale
- 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
- seeSkyFactory.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) Deprecated.Create a sky using the given cubemap or spheremap texture.- Parameters:
assetManager
- from which to load materialstexture
- to usenormalScale
- 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 materialstexture
- to usenormalScale
- 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
- seeSkyFactory.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) Deprecated.Create a sky using the given cubemap or spheremap texture.- Parameters:
assetManager
- from which to load materialstexture
- to usesphereMap
- 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) Deprecated.Create a sky using the given cubemap or spheremap texture.- Parameters:
assetManager
- from which to load materialstextureName
- the path to the texture asset to usesphereMap
- 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 materialstexture
- to useenvMapType
- seeSkyFactory.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 materialstextureName
- the path to the texture asset to useenvMapType
- seeSkyFactory.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 materialswest
- texture for the western face of the cubeeast
- texture for the eastern face of the cubenorth
- texture for the northern face of the cubesouth
- texture for the southern face of the cubeup
- texture for the top face of the cubedown
- texture for the bottom face of the cubenormalScale
- 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 materialswest
- texture for the western face of the cubeeast
- texture for the eastern face of the cubenorth
- texture for the northern face of the cubesouth
- texture for the southern face of the cubeup
- texture for the top face of the cubedown
- texture for the bottom face of the cubenormalScale
- 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 materialswest
- texture for the western face of the cubeeast
- texture for the eastern face of the cubenorth
- texture for the northern face of the cubesouth
- texture for the southern face of the cubeup
- texture for the top face of the cubedown
- texture for the bottom face of the cube- Returns:
- a new spatial representing the sky, ready to be attached to the scene graph
-
createSky(com.jme3.asset.AssetManager, com.jme3.texture.Texture, com.jme3.math.Vector3f, com.jme3.util.SkyFactory.EnvMapType)