Package javax.media.j3d
Class TextureUnitState
java.lang.Object
javax.media.j3d.SceneGraphObject
javax.media.j3d.NodeComponent
javax.media.j3d.TextureUnitState
The TextureUnitState object defines all texture mapping state for a
single texture unit. An appearance object contains an array of
texture unit state objects to define the state for multiple texture
mapping units. The texture unit state consists of the
following:
- Texture - defines the texture image and filtering parameters used when texture mapping is enabled. These attributes are defined in a Texture object.
- Texture attributes - defines the attributes that apply to texture mapping, such as the texture mode, texture transform, blend color, and perspective correction mode. These attributes are defined in a TextureAttributes object.
- Texture coordinate generation - defines the attributes that apply to texture coordinate generation, such as whether texture coordinate generation is enabled, coordinate format (2D or 3D coordinates), coordinate generation mode (object linear, eye linear, or spherical reflection mapping), and the R, S, and T coordinate plane equations. These attributes are defined in a TexCoordGeneration object.
- Since:
- Java 3D 1.2
- See Also:
-
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final int
Specifies that this TextureUnitState object allows reading its texture, texture attribute, or texture coordinate generation component information.static final int
Specifies that this TextureUnitState object allows writing its texture, texture attribute, or texture coordinate generation component information. -
Constructor Summary
ConstructorsConstructorDescriptionConstructs a TextureUnitState component object using defaults for all state variables.TextureUnitState
(Texture texture, TextureAttributes textureAttributes, TexCoordGeneration texCoordGeneration) Constructs a TextureUnitState component object using the specified component objects. -
Method Summary
Modifier and TypeMethodDescriptionDeprecated.replaced with cloneNodeComponent(boolean forceDuplicate)void
duplicateNodeComponent
(NodeComponent originalNodeComponent) Deprecated.replaced with duplicateNodeComponent( NodeComponent originalNodeComponent, boolean forceDuplicate)Retrieves the current texCoordGeneration object.Retrieves the current texture object.Retrieves the current textureAttributes object.void
set
(Texture texture, TextureAttributes textureAttributes, TexCoordGeneration texCoordGeneration) Sets the texture, texture attributes, and texture coordinate generation components in this TextureUnitState object to the specified component objects.void
setTexCoordGeneration
(TexCoordGeneration texCoordGeneration) Sets the texCoordGeneration object to the specified object.void
setTexture
(Texture texture) Sets the texture object to the specified object.void
setTextureAttributes
(TextureAttributes textureAttributes) Sets the textureAttributes object to the specified object.Methods inherited from class javax.media.j3d.NodeComponent
cloneNodeComponent, duplicateNodeComponent, getDuplicateOnCloneTree, setDuplicateOnCloneTree
Methods inherited from class javax.media.j3d.SceneGraphObject
clearCapability, clearCapabilityIsFrequent, duplicateSceneGraphObject, getCapability, getCapabilityIsFrequent, getName, getUserData, isCompiled, isLive, setCapability, setCapabilityIsFrequent, setName, setUserData, toString, updateNodeReferences
-
Field Details
-
ALLOW_STATE_READ
public static final int ALLOW_STATE_READSpecifies that this TextureUnitState object allows reading its texture, texture attribute, or texture coordinate generation component information.- See Also:
-
ALLOW_STATE_WRITE
public static final int ALLOW_STATE_WRITESpecifies that this TextureUnitState object allows writing its texture, texture attribute, or texture coordinate generation component information.- See Also:
-
-
Constructor Details
-
TextureUnitState
public TextureUnitState()Constructs a TextureUnitState component object using defaults for all state variables. All component object references are initialized to null. -
TextureUnitState
public TextureUnitState(Texture texture, TextureAttributes textureAttributes, TexCoordGeneration texCoordGeneration) Constructs a TextureUnitState component object using the specified component objects.- Parameters:
texture
- object that specifies the desired texture map and texture parameterstextureAttributes
- object that specifies the desired texture attributestexCoordGeneration
- object that specifies the texture coordinate generation parameters
-
-
Method Details
-
set
public void set(Texture texture, TextureAttributes textureAttributes, TexCoordGeneration texCoordGeneration) Sets the texture, texture attributes, and texture coordinate generation components in this TextureUnitState object to the specified component objects.- Parameters:
texture
- object that specifies the desired texture map and texture parameterstextureAttributes
- object that specifies the desired texture attributestexCoordGeneration
- object that specifies the texture coordinate generation parameters- Throws:
IllegalSharingException
- if this TextureUnitState is live and the specified texture refers to an ImageComponent2D that is being used by a Canvas3D as an off-screen buffer.IllegalSharingException
- if this TextureUnitState is being used by an immediate mode context and the specified texture refers to an ImageComponent2D that is being used by a Canvas3D as an off-screen buffer.
-
setTexture
Sets the texture object to the specified object. Setting it to null disables texture mapping for the texture unit corresponding to this TextureUnitState object.- Parameters:
texture
- object that specifies the desired texture map and texture parameters- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graphIllegalSharingException
- if this TextureUnitState is live and the specified texture refers to an ImageComponent2D that is being used by a Canvas3D as an off-screen buffer.IllegalSharingException
- if this TextureUnitState is being used by an immediate mode context and the specified texture refers to an ImageComponent2D that is being used by a Canvas3D as an off-screen buffer.
-
getTexture
Retrieves the current texture object.- Returns:
- the texture object
- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
setTextureAttributes
Sets the textureAttributes object to the specified object. Setting it to null will result in default attribute usage for the. texture unit corresponding to this TextureUnitState object.- Parameters:
textureAttributes
- object that specifies the desired texture attributes- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
getTextureAttributes
Retrieves the current textureAttributes object.- Returns:
- the textureAttributes object
- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
setTexCoordGeneration
Sets the texCoordGeneration object to the specified object. Setting it to null disables texture coordinate generation for the texture unit corresponding to this TextureUnitState object.- Parameters:
texCoordGeneration
- object that specifies the texture coordinate generation parameters- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
getTexCoordGeneration
Retrieves the current texCoordGeneration object.- Returns:
- the texCoordGeneration object
- Throws:
CapabilityNotSetException
- if appropriate capability is not set and this object is part of live or compiled scene graph
-
cloneNodeComponent
Deprecated.replaced with cloneNodeComponent(boolean forceDuplicate)- Overrides:
cloneNodeComponent
in classNodeComponent
-
duplicateNodeComponent
Deprecated.replaced with duplicateNodeComponent( NodeComponent originalNodeComponent, boolean forceDuplicate)NOTE: Applications should not call this method directly. It should only be called by the cloneNode method.- Overrides:
duplicateNodeComponent
in classNodeComponent
-