|
j3d.org Aviatrix3D | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Objectorg.j3d.aviatrix3d.SceneGraphObject
org.j3d.aviatrix3d.Node
org.j3d.aviatrix3d.Leaf
org.j3d.aviatrix3d.Background
org.j3d.aviatrix3d.BoxBackground
Background node that renders a sky box using any or all of the 6 textures.
Note that this will take any 2D texture component as the source. However, if that image defines mipmapping, the background ignores it. Only the first (primary) image is used to render the texture.
This will set the background colour to a single colour for the entire
viewport. If used, this will override the setClearColor() on
DrawableSurface
.
Field Summary | |
static int |
NEGATIVE_X
The texture belongs to the negative X axis |
static int |
NEGATIVE_Y
The texture belongs to the negative Y axis |
static int |
NEGATIVE_Z
The texture belongs to the negative Z axis |
static int |
POSITIVE_X
The texture belongs to the positive X axis |
static int |
POSITIVE_Y
The texture belongs to the positive Y axis |
static int |
POSITIVE_Z
The texture belongs to the positive Z axis |
protected boolean |
stateChanged
Flag to say that the display lists must be cleared and regenerated because some state changed |
protected java.util.HashMap[] |
textureIdMap
The mapping of GL context to OpenGL texture ID |
Fields inherited from class org.j3d.aviatrix3d.Background |
dispListMap |
Fields inherited from class org.j3d.aviatrix3d.Node |
bounds, implicitBounds, INVALID_BOUNDS, parent |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
alive, updateHandler, WRITE_TIMING_MSG |
Constructor Summary | |
BoxBackground()
Constructs a background node for a base colour of black. |
|
BoxBackground(float[] c)
Construct a background node for a user-provided colour |
Method Summary | |
void |
cleanup(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Cleanup the object now for the given GL context. |
void |
getColor(float[] c)
Get the current drawing colour |
TextureComponent2D |
getTexture(int side)
Get the current image that is being used on the background. |
protected void |
markBoundsDirty()
Mark this node as having dirty bounds due to one of it's children having their bounds changed. |
void |
postRender(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Restore all openGL state to the given drawable. |
void |
render(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu)
Issue ogl commands needed for this component |
void |
setColor(float[] c)
Change the colour to the new colour. |
void |
setColor(float r,
float g,
float b,
float a)
Change the colour to the new colour. |
void |
setTexture(int side,
TextureComponent2D srcImage)
Set the image source to be used for the background. |
Methods inherited from class org.j3d.aviatrix3d.Node |
boundsChanged, checkForCyclicParent, getBounds, getParent, recomputeBounds, removeParent, setBounds, setLive, setParent, updateBounds |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
checkForCyclicChild, dataChanged, getUserData, isLive, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
Field Detail |
public static final int POSITIVE_X
public static final int NEGATIVE_X
public static final int POSITIVE_Y
public static final int NEGATIVE_Y
public static final int POSITIVE_Z
public static final int NEGATIVE_Z
protected boolean stateChanged
protected java.util.HashMap[] textureIdMap
Constructor Detail |
public BoxBackground()
public BoxBackground(float[] c)
Method Detail |
public void cleanup(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
cleanup
in interface DeletableSceneGraphObject
gl
- The gl context to draw withglu
- The utility context to draw withpublic void render(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
render
in interface RenderableObject
gl
- The gl context to draw withglu
- The utility context to draw withpublic void postRender(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu)
postRender
in interface RenderableObject
gl
- The gl context to draw withglu
- The utility context to draw withprotected void markBoundsDirty()
markBoundsDirty
in class Node
public void setColor(float[] c) throws InvalidWriteTimingException
c
- The colour to copy in
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic void setColor(float r, float g, float b, float a) throws InvalidWriteTimingException
r
- The red colour component to useg
- The green colour component to useb
- The blue colour component to usea
- The alpha colour component to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic void getColor(float[] c)
c
- An array of length 4 or more to copy the colour topublic void setTexture(int side, TextureComponent2D srcImage) throws InvalidWriteTimingException
side
- Which side of the box to get the texture forsrcImage
- The image data to use
InvalidWriteTimingException
- An attempt was made to write outside
of the NodeUpdateListener callback methodpublic TextureComponent2D getTexture(int side)
side
- Which side of the box to get the texture for
|
j3d.org Aviatrix3D | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |