Package com.jme3.texture
Class Texture
java.lang.Object
com.jme3.texture.Texture
- All Implemented Interfaces:
- CloneableSmartAsset,- Savable,- Cloneable
- Direct Known Subclasses:
- Texture2D,- Texture3D,- TextureArray,- TextureCubeMap
Texture defines a texture object to be used to display an
 image on a piece of geometry. The image to be displayed is defined by the
 Image class. All attributes required for texture mapping are
 contained within this class. This includes mipmapping if desired,
 magnificationFilter options, apply options and correction options. Default
 values are as follows: minificationFilter - NearestNeighborNoMipMaps,
 magnificationFilter - NearestNeighbor, wrap - EdgeClamp on S,T and R, apply -
 Modulate, environment - None.- See Also:
- 
Nested Class SummaryNested ClassesModifier and TypeClassDescriptionstatic enumstatic enumstatic enumIf this texture is a depth texture (the format is Depth*) then this value may be used to compare the texture depth to the R texture coordinate.static enumstatic enumstatic enum
- 
Constructor SummaryConstructorsConstructorDescriptionTexture()Constructor instantiates a newTextureobject with default attributes.
- 
Method SummaryModifier and TypeMethodDescriptionclone()Creates a clone of the asset.abstract TextureDeprecated.createSimpleClone(Texture rVal) Deprecated.Useclone()instead.booleanintgetImage()getImagereturns the image data that makes up this texture.getKey()Returns the asset key that is used to track this asset for garbage collection.getName()abstract Texture.TypegetType()abstract Texture.WrapModegetWrap(Texture.WrapAxis axis) getWrapreturns the wrap mode for a given coordinate axis on this texture.inthashCode()voidread(JmeImporter importer) voidsetAnisotropicFilter(int level) voidsetImagesets the image object that defines the texture.voidSet by theAssetManagerto track this asset.voidsetMagFilter(Texture.MagFilter magnificationFilter) voidsetMinFilter(Texture.MinFilter minificationFilter) voidvoidsetShadowCompareMode(Texture.ShadowCompareMode compareMode) abstract voidsetWrap(Texture.WrapAxis axis, Texture.WrapMode mode) setWrapsets the wrap mode of this texture for a particular axis.abstract voidsetWrap(Texture.WrapMode mode) setWrapsets the wrap mode of this texture for all axis.toString()voidwrite(JmeExporter e) 
- 
Constructor Details- 
Texturepublic Texture()Constructor instantiates a newTextureobject with default attributes.
 
- 
- 
Method Details- 
cloneDescription copied from interface:CloneableSmartAssetCreates a clone of the asset. Please seeObject.clone()for more info on how this method should be implemented.- Specified by:
- clonein interface- CloneableSmartAsset
- Overrides:
- clonein class- Object
- Returns:
- A cloned Texture object.
 
- 
getMinFilter- Returns:
- the MinificationFilterMode of this texture.
 
- 
setMinFilter- Parameters:
- minificationFilter- the new MinificationFilterMode for this texture.
- Throws:
- IllegalArgumentException- if minificationFilter is null
 
- 
getMagFilter- Returns:
- the MagnificationFilterMode of this texture.
 
- 
setMagFilter- Parameters:
- magnificationFilter- the new MagnificationFilter for this texture.
- Throws:
- IllegalArgumentException- if magnificationFilter is null
 
- 
getShadowCompareMode- Returns:
- The ShadowCompareMode of this texture.
- See Also:
 
- 
setShadowCompareMode- Parameters:
- compareMode- the new ShadowCompareMode for this texture.
- Throws:
- IllegalArgumentException- if compareMode is null
- See Also:
 
- 
setImagesetImagesets the image object that defines the texture.- Parameters:
- image- the image that defines the texture.
 
- 
setKeyDescription copied from interface:CloneableSmartAssetSet by theAssetManagerto track this asset. Only clones of the asset has this set, the original copy that was loaded has this key set to null so that only the clones are tracked for garbage collection.- Specified by:
- setKeyin interface- CloneableSmartAsset
- Parameters:
- key- The texture key that was used to load this texture
 
- 
getKeyDescription copied from interface:CloneableSmartAssetReturns the asset key that is used to track this asset for garbage collection.- Specified by:
- getKeyin interface- CloneableSmartAsset
- Returns:
- the asset key that is used to track this asset for garbage collection.
 
- 
getImagegetImagereturns the image data that makes up this texture. If no image data has been set, this will return null.- Returns:
- the image data that makes up the texture.
 
- 
setWrapsetWrapsets the wrap mode of this texture for a particular axis.- Parameters:
- axis- the texture axis to apply the wrap mode to.
- mode- the wrap mode for the given axis of the texture.
- Throws:
- IllegalArgumentException- if axis or mode are null or invalid for this type of texture
 
- 
setWrapsetWrapsets the wrap mode of this texture for all axis.- Parameters:
- mode- the wrap mode for the given axis of the texture.
- Throws:
- IllegalArgumentException- if mode is null or invalid for this type of texture
 
- 
getWrapgetWrapreturns the wrap mode for a given coordinate axis on this texture.- Parameters:
- axis- the axis to return for
- Returns:
- the wrap mode of the texture.
- Throws:
- IllegalArgumentException- if axis is null or invalid for this type of texture
 
- 
getType
- 
getName
- 
setName
- 
getAnisotropicFilterpublic int getAnisotropicFilter()- Returns:
- the anisotropic filtering level for this texture. Default value is 0 (use value from config), 1 means 1x (no anisotropy), 2 means x2, 4 is x4, etc.
 
- 
setAnisotropicFilterpublic void setAnisotropicFilter(int level) - Parameters:
- level- the anisotropic filtering level for this texture.
 
- 
toString
- 
equals
- 
hashCodepublic int hashCode()
- 
createSimpleCloneDeprecated.Useclone()instead.Retrieve a basic clone of this Texture (ie, clone everything but the image data, which is shared)- Parameters:
- rVal- storage for the clone (not null, modified)
- Returns:
- Texture
 
- 
createSimpleCloneDeprecated.Useclone()instead.- Returns:
- a new Texture
 
- 
write- Specified by:
- writein interface- Savable
- Throws:
- IOException
 
- 
read- Specified by:
- readin interface- Savable
- Throws:
- IOException
 
 
- 
clone()instead.