|
Aviatrix3D 2.1.0 |
|||||||||
| 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.NodeComponent
org.j3d.aviatrix3d.TextureUnit
public class TextureUnit
Describes a texture stage and its associated texture and attributes.
The external data passed to the ComponentRenderable calls shall be an
Integer instance that represents the GL texture unit of the
this instance is working with. If the value is -1, then only a single
texture is being used, so the class does not need to make use of the
glActiveTexture() call.
Internationalisation Resource Names
| Field Summary |
|---|
| Fields inherited from class org.j3d.aviatrix3d.NodeComponent |
|---|
lastParent, liveCount, parentList |
| Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
|---|
alive, LISTENER_SET_TIMING_ERR_PROP, updateHandler |
| Constructor Summary | |
|---|---|
TextureUnit()
Constructs a Texture Unit with default values. |
|
TextureUnit(Texture t,
TextureAttributes attrs,
TexCoordGeneration tcg)
Construct a Texture Unit with the specified texture, attributes and coordinate generation. |
|
| Method Summary | |
|---|---|
void |
activateTexture(javax.media.opengl.GL gl,
java.lang.Object stageId)
Activate the texture now. |
protected void |
checkForCyclicChild(SceneGraphObject parent)
Check to see if this node is the same reference as the passed node that is a parent of this node. |
int |
compareTo(java.lang.Object o)
Compares this object with the specified object for order. |
int |
compareTo(TextureUnit tu)
Compares this object with the specified object for order. |
void |
deactivateTexture(javax.media.opengl.GL gl,
java.lang.Object stageId)
Deactivate the texture now so that it is no longer a valid rendering target. |
boolean |
equals(java.lang.Object o)
Compare this object for equality to the given object. |
boolean |
equals(TextureUnit tu)
Compares this object with the specified object to check for equivalence. |
OffscreenBufferDescriptor |
getBuffer(javax.media.opengl.GLContext context)
Fetch the underlying source buffer for the offscreen rendering that relates to this particular texture. |
OffscreenCullable |
getOffscreenSource()
Fetch the offscreen texture source that this renderable holds on to. |
TexCoordGeneration |
getTexCoordGeneration()
Get the currently set texture. |
Texture |
getTexture()
Get the currently set texture. |
TextureAttributes |
getTextureAttributes()
Get the currently set texture attributes. |
void |
getTextureTransform(javax.vecmath.Matrix4f mat)
Get the current local texture transformation maxtix. |
boolean |
hasTransparency()
Ask the texture if it has any transparency values. |
boolean |
isMultiTextureAllowed()
Convenience method to check if this code has detected the prescense of multitexture extensions. |
boolean |
isOffscreenBuffer()
Check to see if this is an offscreen buffer that is separately rendered rather than using explicit image data. |
boolean |
isOffscreenSource()
Check to see if the contained texture is an offscreen renderable such as OffscreenTexture2D or MRTOffscreenTexture2D that contains
a subscene graph to be rendered. |
void |
postRender(javax.media.opengl.GL gl,
java.lang.Object stageId)
Restore all openGL state to the given drawable. |
void |
render(javax.media.opengl.GL gl,
java.lang.Object stageId)
Issue ogl commands needed for this component |
protected void |
setLive(boolean state)
Notification that this object is live now. |
void |
setTexCoordGeneration(TexCoordGeneration tcg)
Set the texture coordinate generation for this stage. |
void |
setTexture(Texture tex)
Set the texture for this stage. |
void |
setTextureAttributes(TextureAttributes attrs)
Set the texture attributes for this stage. |
void |
setTextureTransform(javax.vecmath.Matrix4f mat)
Set the current texture transform matrix. |
protected void |
setUpdateHandler(NodeUpdateHandler handler)
Set the scenegraph update handler for this node. |
| Methods inherited from class org.j3d.aviatrix3d.NodeComponent |
|---|
addParent, getParents, numParents, removeParent |
| Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
|---|
checkForCyclicParent, dataChanged, getAppUpdateWriteTimingMessage, getBoundsWriteTimingMessage, getDataWriteTimingMessage, getUserData, isLive, setUserData |
| Methods inherited from class java.lang.Object |
|---|
clone, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait |
| Constructor Detail |
|---|
public TextureUnit()
public TextureUnit(Texture t,
TextureAttributes attrs,
TexCoordGeneration tcg)
t - The texture instance to useattrs - Attributes used to control the visual appearancetcg - Automated texture coordinate generation, if needed| Method Detail |
|---|
protected void checkForCyclicChild(SceneGraphObject parent)
throws CyclicSceneGraphStructureException
checkForCyclicChild in class SceneGraphObjectparent - The reference to check against this class
CyclicSceneGraphStructureException - Equal parent and childprotected void setUpdateHandler(NodeUpdateHandler handler)
setUpdateHandler in class SceneGraphObjecthandler - The instance to use as a handlerprotected void setLive(boolean state)
setLive in class SceneGraphObjectstate - true if this should be marked as live nowpublic boolean hasTransparency()
hasTransparency in interface TransparentRenderablepublic boolean isOffscreenSource()
OffscreenTexture2D or MRTOffscreenTexture2D that contains
a subscene graph to be rendered. If is is, then the
getOffscreenSource() method will return the contained cullable.
isOffscreenSource in interface TextureRenderablepublic OffscreenCullable getOffscreenSource()
getOffscreenSource in interface TextureRenderablepublic boolean isOffscreenBuffer()
isOffscreenSource()
method is used to determine that.
isOffscreenBuffer in interface TextureRenderablepublic OffscreenBufferDescriptor getBuffer(javax.media.opengl.GLContext context)
getBuffer in interface TextureRenderablecontext - The containing context to find the matching buffer for
public void activateTexture(javax.media.opengl.GL gl,
java.lang.Object stageId)
activateTexture in interface TextureRenderablegl - The GL context to render withstageId - The ID of the texture stage we're reading
public void deactivateTexture(javax.media.opengl.GL gl,
java.lang.Object stageId)
deactivateTexture in interface TextureRenderablegl - The GL context to render withstageId - The ID of the texture stage we're reading
public void render(javax.media.opengl.GL gl,
java.lang.Object stageId)
render in interface ComponentRenderablegl - The gl context to draw withstageId - The ID of the texture stage we're reading
public void postRender(javax.media.opengl.GL gl,
java.lang.Object stageId)
postRender in interface ComponentRenderablegl - The gl context to draw withstageId - The ID of the texture stage we're reading
public int compareTo(java.lang.Object o)
throws java.lang.ClassCastException
compareTo in interface java.lang.Comparableo - The object 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 Renderableequals in class java.lang.Objecto - The object to be compared
public void setTexture(Texture tex)
throws InvalidWriteTimingException
tex - The texture to be used or null
InvalidWriteTimingException - An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic Texture getTexture()
public void setTextureAttributes(TextureAttributes attrs)
throws InvalidWriteTimingException
attrs - The texture attributes. Null clears.
InvalidWriteTimingException - An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic TextureAttributes getTextureAttributes()
public void setTexCoordGeneration(TexCoordGeneration tcg)
throws InvalidWriteTimingException
tcg - The texture coordinate generation. Null clears.
InvalidWriteTimingException - An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic TexCoordGeneration getTexCoordGeneration()
public void setTextureTransform(javax.vecmath.Matrix4f mat)
throws InvalidWriteTimingException
mat - The matrix to modify textures by, or null
InvalidWriteTimingException - An attempt was made to write outside
of the NodeUpdateListener data changed callback methodpublic void getTextureTransform(javax.vecmath.Matrix4f mat)
mat - The matrix to copy the current values intopublic int compareTo(TextureUnit tu)
tu - The texture unit instance to be compared
public boolean equals(TextureUnit tu)
tu - The texture unit instance to be compared
public boolean isMultiTextureAllowed()
|
Aviatrix3D 2.1.0 |
|||||||||
| PREV CLASS NEXT CLASS | FRAMES NO FRAMES | |||||||||
| SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD | |||||||||