|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |
java.lang.Object org.j3d.aviatrix3d.SceneGraphObject org.j3d.aviatrix3d.Node org.j3d.aviatrix3d.Leaf org.j3d.aviatrix3d.Background org.j3d.aviatrix3d.BoxBackground
public class 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. The size of the box is 2x2x2 centered at the local origin.
This will set the background colour to a single colour for the entire
viewport. If used, this will override the setClearColor() on
GraphicsOutputDevice
.
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 |
Fields inherited from class org.j3d.aviatrix3d.Background |
---|
color, dispListMap, INVALID_ALPHA_PROP, INVALID_BLUE_PROP, INVALID_GREEN_PROP, INVALID_RED_PROP, useClearColor |
Fields inherited from class org.j3d.aviatrix3d.Node |
---|
bounds, implicitBounds, INVALID_BOUNDS, parent |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
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(javax.media.opengl.GL gl)
Cleanup the object now for the given GL context. |
int |
compareTo(BoxBackground bg)
Compares this object with the specified object for order. |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
boolean |
equals(BoxBackground bg)
Compares this object with the specified object to check for equivalence. |
boolean |
equals(java.lang.Object o)
Compare this object for equality to the given object. |
TextureComponent2D |
getTexture(int side)
Get the current image that is being used on the background. |
boolean |
is2D()
Check to see whether this shape is something that represents 2D or 3D renderable background. |
void |
postRender(javax.media.opengl.GL gl)
Restore all openGL state to the given drawable. |
void |
render(javax.media.opengl.GL gl)
Issue ogl commands needed for this component |
void |
setTexture(int side,
TextureComponent2D srcImage)
Set the image source to be used for the background. |
Methods inherited from class org.j3d.aviatrix3d.Background |
---|
compareColor4, equalsColor4, getColor, getCullableParent, getRenderable, isColorClearEnabled, markBoundsDirty, setColor, setColor, setColorClearEnabled |
Methods inherited from class org.j3d.aviatrix3d.Node |
---|
boundsChanged, checkForCyclicParent, getBounds, getParent, recomputeBounds, removeParent, requestBoundsUpdate, setBounds, setParent, updateBounds, updateParentBounds |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
---|
checkForCyclicChild, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setLive, setUpdateHandler, setUserData |
Methods inherited from class java.lang.Object |
---|
clone, 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
Constructor Detail |
---|
public BoxBackground()
public BoxBackground(float[] c)
c
- The array of colours to use, or null
java.lang.IllegalArgumentException
- The colour array is not long enoughMethod Detail |
---|
public void cleanup(javax.media.opengl.GL gl)
cleanup
in interface DeletableRenderable
gl
- The gl context to draw withpublic boolean is2D()
is2D
in interface BackgroundRenderable
public void render(javax.media.opengl.GL gl)
render
in interface ObjectRenderable
gl
- The gl context to draw withpublic void postRender(javax.media.opengl.GL gl)
postRender
in interface ObjectRenderable
gl
- The gl context to draw withpublic int compareTo(java.lang.Object o) throws java.lang.ClassCastException
compareTo
in interface java.lang.Comparable
o
- The objec to be compared
java.lang.ClassCastException
- The specified object's type prevents it from
being compared to this Objectpublic boolean equals(java.lang.Object o)
equals
in interface Renderable
equals
in class java.lang.Object
o
- The object to be compared
public 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 data changed callback methodpublic TextureComponent2D getTexture(int side)
side
- Which side of the box to get the texture for
public int compareTo(BoxBackground bg)
bg
- The argument instance to be compared
public boolean equals(BoxBackground bg)
bg
- The background instance to be compared
|
Aviatrix3D 2.1.0 |
|||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |