org.xith3d.scenegraph.primitives
Class SkyBox

java.lang.Object
  extended by org.xith3d.render.RenderPass
      extended by org.xith3d.render.BackgroundRenderPass
          extended by org.xith3d.scenegraph.primitives.SkyBox
All Implemented Interfaces:
org.jagatoo.datatypes.Enableable, org.jagatoo.datatypes.NamableObject, org.jagatoo.datatypes.NamedObject

public class SkyBox
extends BackgroundRenderPass

A SkyBox is a special type of Background Node. It is a six sided cube which is actually very small (20 x 20 x 20). It is drawn with the depth buffer disabled, so all objects which are drawn after it will be drawn in front. As it is a background node, it will always be drawn as if the camera was in its center regardless of the actual position of the camera. For realism, the six textures need to be carefully constructed with a 90 degree field of view. Typically this can be done in most 3d terrain generation programs (for example Terragen).


Constructor Summary
SkyBox(CubeTextureSet textureSet)
           
SkyBox(java.lang.String[] textures)
          Creates a new SkyBox using the six given Textures.
SkyBox(java.lang.String[] textures, boolean flipVertically)
          Creates a new SkyBox using the six given Textures.
SkyBox(java.lang.String front, java.lang.String right, java.lang.String back, java.lang.String left, java.lang.String top, java.lang.String bottom)
          Creates a new SkyBox using the six given Textures.
SkyBox(java.lang.String front, java.lang.String right, java.lang.String back, java.lang.String left, java.lang.String top, java.lang.String bottom, boolean flipVertically)
          Creates a new SkyBox using the six given Textures.
SkyBox(Texture[] textures)
          Creates a new SkyBox using the six given Textures.
SkyBox(Texture front, Texture right, Texture back, Texture left, Texture top, Texture bottom)
          Creates a new SkyBox using the six given Textures.
 
Method Summary
static BranchGroup createSkyBoxGroup(CubeTextureSet textureSet)
           
static BranchGroup createSkyBoxGroup(float size, Texture[] textures)
           
static
<G extends GroupNode>
G
createSkyBoxGroup(float size, Texture[] textures, G group)
           
static BranchGroup createSkyBoxGroup(java.lang.String[] textures)
          Creates a new SkyBox using the six given Textures.
static BranchGroup createSkyBoxGroup(java.lang.String[] textures, boolean flipTextures)
          Creates a new SkyBox using the six given Textures.
static BranchGroup createSkyBoxGroup(java.lang.String front, java.lang.String right, java.lang.String back, java.lang.String left, java.lang.String top, java.lang.String bottom)
          Creates a new SkyBox using the six given Textures.
static BranchGroup createSkyBoxGroup(java.lang.String front, java.lang.String right, java.lang.String back, java.lang.String left, java.lang.String top, java.lang.String bottom, boolean flipVertically)
          Creates a new SkyBox using the six given Textures.
static
<G extends GroupNode>
G
createSkyBoxGroup(Texture[] textures, G group)
           
static BranchGroup createSkyBoxGroup(Texture front, Texture right, Texture back, Texture left, Texture top, Texture bottom)
          Creates a new SkyBox using the six given Textures.
 
Methods inherited from class org.xith3d.render.BackgroundRenderPass
createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createParallel, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, createPerspective, isFrustumCullingEnabled, setFrustumCullingEnabled
 
Methods inherited from class org.xith3d.render.RenderPass
addRenderCallback, create2D, create2D, create2D, create2D, create2D, create2D, create2D, create2D, create2D, create2D, create2D, create2D, create2D, create2D, create2D, create2D, create2D, create2D, create2D, create2D, create2D, create2D, create2D, create2D, createRenderBinProvider, freeOpenGLResources, freeOpenGLResources, getBranchGroup, getConfig, getName, getRenderBinProvider, getRenderCallbackNotifier, getRenderTarget, getShadowCasterLight, isClipperEnabled, isEnabled, isLayeredModeForced, isScissorEnabled, isUnlayeredModeForced, removeRenderCallback, setBranchGroup, setClipperEnabled, setConfig, setEnabled, setLayeredModeForced, setName, setRenderTarget, setScissorEnabled, setShadowCasterLight, setUnlayeredModeForced, switchWireframeMode
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

SkyBox

public SkyBox(Texture[] textures)
Creates a new SkyBox using the six given Textures. Null may be passed instead of the Texture, and those sides which null was passed will not be included in the SkyBox (e.g. if you don't need a bottom or top to the SkyBox, simply pass null for those Textures).

Parameters:
textures - a six elemental array of Textures of the following form:
[0] The front image (0 degrees rotation, 0 degrees pitch) [1] The right image (90 degrees rotation, 0 degrees pitch) [2] The back image (180 degrees rotation, 0 degrees pitch) [3] The left image (270 degrees rotation, 0 degrees pitch) [4] The top image (0 degrees rotation, -90 degrees pitch) [5] The bottom image (0 degrees rotation, 90 degrees pitch)

SkyBox

public SkyBox(Texture front,
              Texture right,
              Texture back,
              Texture left,
              Texture top,
              Texture bottom)
Creates a new SkyBox using the six given Textures. Null may be passed instead of the Texture, and those sides which null was passed will not be included in the SkyBox (e.g. if you don't need a bottom or top to the SkyBox, simply pass null for those Textures).

Parameters:
front - The front image (0 degrees rotation, 0 degrees pitch)
right - The right image (90 degrees rotation, 0 degrees pitch)
back - The back image (180 degrees rotation, 0 degrees pitch)
left - The left image (270 degrees rotation, 0 degrees pitch)
top - The top image (0 degrees rotation, -90 degrees pitch)
bottom - The bottom image (0 degrees rotation, 90 degrees pitch)

SkyBox

public SkyBox(java.lang.String[] textures,
              boolean flipVertically)
Creates a new SkyBox using the six given Textures. Null may be passed instead of the Texture filename, and those sides which null was passed will not be included in the SkyBox (e.g. if you don't need a bottom or top to the SkyBox, simply pass null for those Textures).

Parameters:
textures - a six elemental array of Textures of the following form:
[0] The front image (0 degrees rotation, 0 degrees pitch) [1] The right image (90 degrees rotation, 0 degrees pitch) [2] The back image (180 degrees rotation, 0 degrees pitch) [3] The left image (270 degrees rotation, 0 degrees pitch) [4] The top image (0 degrees rotation, -90 degrees pitch) [5] The bottom image (0 degrees rotation, 90 degrees pitch)

SkyBox

public SkyBox(java.lang.String[] textures)
Creates a new SkyBox using the six given Textures. Null may be passed instead of the Texture filename, and those sides which null was passed will not be included in the SkyBox (e.g. if you don't need a bottom or top to the SkyBox, simply pass null for those Textures).

Parameters:
textures - a six elemental array of Textures of the following form:
[0] The front image (0 degrees rotation, 0 degrees pitch) [1] The right image (90 degrees rotation, 0 degrees pitch) [2] The back image (180 degrees rotation, 0 degrees pitch) [3] The left image (270 degrees rotation, 0 degrees pitch) [4] The top image (0 degrees rotation, -90 degrees pitch) [5] The bottom image (0 degrees rotation, 90 degrees pitch)

SkyBox

public SkyBox(java.lang.String front,
              java.lang.String right,
              java.lang.String back,
              java.lang.String left,
              java.lang.String top,
              java.lang.String bottom,
              boolean flipVertically)
Creates a new SkyBox using the six given Textures. Null may be passed instead of the Texture filename, and those sides which null was passed will not be included in the SkyBox (e.g. if you don't need a bottom or top to the SkyBox, simply pass null for those Textures).

Parameters:
front - The front image (0 degrees rotation, 0 degrees pitch)
right - The right image (90 degrees rotation, 0 degrees pitch)
back - The back image (180 degrees rotation, 0 degrees pitch)
left - The left image (270 degrees rotation, 0 degrees pitch)
top - The top image (0 degrees rotation, -90 degrees pitch)
bottom - The bottom image (0 degrees rotation, 90 degrees pitch)
flipVertically -

SkyBox

public SkyBox(java.lang.String front,
              java.lang.String right,
              java.lang.String back,
              java.lang.String left,
              java.lang.String top,
              java.lang.String bottom)
Creates a new SkyBox using the six given Textures. Null may be passed instead of the Texture filename, and those sides which null was passed will not be included in the SkyBox (e.g. if you don't need a bottom or top to the SkyBox, simply pass null for those Textures).

Parameters:
front - The front image (0 degrees rotation, 0 degrees pitch)
right - The right image (90 degrees rotation, 0 degrees pitch)
back - The back image (180 degrees rotation, 0 degrees pitch)
left - The left image (270 degrees rotation, 0 degrees pitch)
top - The top image (0 degrees rotation, -90 degrees pitch)
bottom - The bottom image (0 degrees rotation, 90 degrees pitch)

SkyBox

public SkyBox(CubeTextureSet textureSet)
Method Detail

createSkyBoxGroup

public static <G extends GroupNode> G createSkyBoxGroup(float size,
                                                        Texture[] textures,
                                                        G group)

createSkyBoxGroup

public static <G extends GroupNode> G createSkyBoxGroup(Texture[] textures,
                                                        G group)

createSkyBoxGroup

public static BranchGroup createSkyBoxGroup(float size,
                                            Texture[] textures)

createSkyBoxGroup

public static final BranchGroup createSkyBoxGroup(Texture front,
                                                  Texture right,
                                                  Texture back,
                                                  Texture left,
                                                  Texture top,
                                                  Texture bottom)
Creates a new SkyBox using the six given Textures. Null may be passed instead of the Texture, and those sides which null was passed will not be included in the SkyBox (e.g. if you don't need a bottom or top to the SkyBox, simply pass null for those Textures).

Parameters:
front - The front image (0 degrees rotation, 0 degrees pitch)
right - The right image (90 degrees rotation, 0 degrees pitch)
back - The back image (180 degrees rotation, 0 degrees pitch)
left - The left image (270 degrees rotation, 0 degrees pitch)
top - The top image (0 degrees rotation, -90 degrees pitch)
bottom - The bottom image (0 degrees rotation, 90 degrees pitch)

createSkyBoxGroup

public static final BranchGroup createSkyBoxGroup(java.lang.String[] textures,
                                                  boolean flipTextures)
Creates a new SkyBox using the six given Textures. Null may be passed instead of the Texture filename, and those sides which null was passed will not be included in the SkyBox (e.g. if you don't need a bottom or top to the SkyBox, simply pass null for those Textures).

Parameters:
textures - a six elemental array of Textures of the following form:
[0] The front image (0 degrees rotation, 0 degrees pitch) [1] The right image (90 degrees rotation, 0 degrees pitch) [2] The back image (180 degrees rotation, 0 degrees pitch) [3] The left image (270 degrees rotation, 0 degrees pitch) [4] The top image (0 degrees rotation, -90 degrees pitch) [5] The bottom image (0 degrees rotation, 90 degrees pitch)
flipTextures - flip textures vertically?

createSkyBoxGroup

public static final BranchGroup createSkyBoxGroup(java.lang.String[] textures)
Creates a new SkyBox using the six given Textures. Null may be passed instead of the Texture filename, and those sides which null was passed will not be included in the SkyBox (e.g. if you don't need a bottom or top to the SkyBox, simply pass null for those Textures).

Parameters:
textures - a six elemental array of Textures of the following form:
[0] The front image (0 degrees rotation, 0 degrees pitch) [1] The right image (90 degrees rotation, 0 degrees pitch) [2] The back image (180 degrees rotation, 0 degrees pitch) [3] The left image (270 degrees rotation, 0 degrees pitch) [4] The top image (0 degrees rotation, -90 degrees pitch) [5] The bottom image (0 degrees rotation, 90 degrees pitch)

createSkyBoxGroup

public static final BranchGroup createSkyBoxGroup(java.lang.String front,
                                                  java.lang.String right,
                                                  java.lang.String back,
                                                  java.lang.String left,
                                                  java.lang.String top,
                                                  java.lang.String bottom,
                                                  boolean flipVertically)
Creates a new SkyBox using the six given Textures. Null may be passed instead of the Texture filename, and those sides which null was passed will not be included in the SkyBox (e.g. if you don't need a bottom or top to the SkyBox, simply pass null for those Textures).

Parameters:
front - The front image (0 degrees rotation, 0 degrees pitch)
right - The right image (90 degrees rotation, 0 degrees pitch)
back - The back image (180 degrees rotation, 0 degrees pitch)
left - The left image (270 degrees rotation, 0 degrees pitch)
top - The top image (0 degrees rotation, -90 degrees pitch)
bottom - The bottom image (0 degrees rotation, 90 degrees pitch)
flipVertically -

createSkyBoxGroup

public static final BranchGroup createSkyBoxGroup(java.lang.String front,
                                                  java.lang.String right,
                                                  java.lang.String back,
                                                  java.lang.String left,
                                                  java.lang.String top,
                                                  java.lang.String bottom)
Creates a new SkyBox using the six given Textures. Null may be passed instead of the Texture filename, and those sides which null was passed will not be included in the SkyBox (e.g. if you don't need a bottom or top to the SkyBox, simply pass null for those Textures).

Parameters:
front - The front image (0 degrees rotation, 0 degrees pitch)
right - The right image (90 degrees rotation, 0 degrees pitch)
back - The back image (180 degrees rotation, 0 degrees pitch)
left - The left image (270 degrees rotation, 0 degrees pitch)
top - The top image (0 degrees rotation, -90 degrees pitch)
bottom - The bottom image (0 degrees rotation, 90 degrees pitch)

createSkyBoxGroup

public static final BranchGroup createSkyBoxGroup(CubeTextureSet textureSet)