|
Aviatrix3D 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
Describes a texture stage and its associated texture and attributes.
The external data passed to the RenderableComponent 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.
Field Summary |
Fields inherited from class org.j3d.aviatrix3d.NodeComponent |
lastParent, liveCount, parentList |
Fields inherited from class org.j3d.aviatrix3d.SceneGraphObject |
alive, LISTENER_SET_NOT_LIVE_MESSAGE, updateHandler, WRITE_TIMING_MSG |
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 | |
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. |
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. |
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 |
isMultiTextureAllowed()
Convenience method to check if this code has detected the prescense of multitexture extensions. |
void |
postRender(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu,
java.lang.Object stageId)
Restore all openGL state to the given drawable. |
void |
render(net.java.games.jogl.GL gl,
net.java.games.jogl.GLU glu,
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, hasChanged, numParents, removeParent |
Methods inherited from class org.j3d.aviatrix3d.SceneGraphObject |
checkForCyclicParent, dataChanged, 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 neededMethod Detail |
protected void checkForCyclicChild(SceneGraphObject parent) throws CyclicSceneGraphStructureException
checkForCyclicChild
in class SceneGraphObject
parent
- The reference to check against this class
CyclicSceneGraphStructureException
- Equal parent and childprotected void setUpdateHandler(NodeUpdateHandler handler)
setUpdateHandler
in class SceneGraphObject
handler
- The instance to use as a handlerprotected void setLive(boolean state)
setLive
in class SceneGraphObject
state
- true if this should be marked as live nowpublic void render(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu, java.lang.Object stageId)
render
in interface RenderableComponent
gl
- The gl context to draw withglu
- The utility context to draw withstageId
- The ID of the texture stage we're readingpublic void postRender(net.java.games.jogl.GL gl, net.java.games.jogl.GLU glu, java.lang.Object stageId)
postRender
in interface RenderableComponent
gl
- The gl context to draw withglu
- The utility context to draw withstageId
- The ID of the texture stage we're readingpublic int compareTo(java.lang.Object o) throws java.lang.ClassCastException
Derived classes should extend this one to add the extra comparisons needed.
compareTo
in interface java.lang.Comparable
o
- 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)
o
- 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 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 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 callback methodpublic TexCoordGeneration getTexCoordGeneration()
public void setTextureTransform(javax.vecmath.Matrix4f mat) throws InvalidWriteTimingException
mat
- The matrix to modify textures by, or null
InvalidWriteTimingException
public void getTextureTransform(javax.vecmath.Matrix4f mat)
mat
- The matrix to copy the current values intopublic int compareTo(TextureUnit tu)
Derived classes should extend this one to add the extra comparisons needed.
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 1.0 | ||||||||||
PREV CLASS NEXT CLASS | FRAMES NO FRAMES | ||||||||||
SUMMARY: NESTED | FIELD | CONSTR | METHOD | DETAIL: FIELD | CONSTR | METHOD |