public abstract class Texture extends java.lang.Object implements CloneableSmartAsset, Savable, java.lang.Cloneable
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.Image
Modifier and Type | Class and Description |
---|---|
static class |
Texture.MagFilter |
static class |
Texture.MinFilter |
static class |
Texture.ShadowCompareMode
If 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 class |
Texture.Type |
static class |
Texture.WrapAxis |
static class |
Texture.WrapMode |
Constructor and Description |
---|
Texture()
Constructor instantiates a new
Texture object with default
attributes. |
Modifier and Type | Method and Description |
---|---|
Texture |
clone()
Creates a clone of the asset.
|
abstract Texture |
createSimpleClone()
Deprecated.
Use
clone() instead. |
Texture |
createSimpleClone(Texture rVal)
Deprecated.
Use
clone() instead. |
boolean |
equals(java.lang.Object obj) |
int |
getAnisotropicFilter() |
Image |
getImage()
getImage returns the image data that makes up this
texture. |
AssetKey |
getKey()
Returns the asset key that is used to track this asset for garbage
collection.
|
Texture.MagFilter |
getMagFilter() |
Texture.MinFilter |
getMinFilter() |
java.lang.String |
getName() |
Texture.ShadowCompareMode |
getShadowCompareMode() |
abstract Texture.Type |
getType() |
abstract Texture.WrapMode |
getWrap(Texture.WrapAxis axis)
getWrap returns the wrap mode for a given coordinate axis
on this texture. |
int |
hashCode() |
void |
read(JmeImporter e) |
void |
setAnisotropicFilter(int level) |
void |
setImage(Image image)
setImage sets the image object that defines the texture. |
void |
setKey(AssetKey key)
Set by the
AssetManager to track this asset. |
void |
setMagFilter(Texture.MagFilter magnificationFilter) |
void |
setMinFilter(Texture.MinFilter minificationFilter) |
void |
setName(java.lang.String name) |
void |
setShadowCompareMode(Texture.ShadowCompareMode compareMode) |
abstract void |
setWrap(Texture.WrapAxis axis,
Texture.WrapMode mode)
setWrap sets the wrap mode of this texture for a
particular axis. |
abstract void |
setWrap(Texture.WrapMode mode)
setWrap sets the wrap mode of this texture for all axis. |
java.lang.String |
toString() |
void |
write(JmeExporter e) |
public Texture()
Texture
object with default
attributes.public Texture clone()
CloneableSmartAsset
Object.clone()
for more info on how this method
should be implemented.clone
in interface CloneableSmartAsset
clone
in class java.lang.Object
public Texture.MinFilter getMinFilter()
public void setMinFilter(Texture.MinFilter minificationFilter)
minificationFilter
- the new MinificationFilterMode for this texture.java.lang.IllegalArgumentException
- if minificationFilter is nullpublic Texture.MagFilter getMagFilter()
public void setMagFilter(Texture.MagFilter magnificationFilter)
magnificationFilter
- the new MagnificationFilter for this texture.java.lang.IllegalArgumentException
- if magnificationFilter is nullpublic Texture.ShadowCompareMode getShadowCompareMode()
Texture.ShadowCompareMode
public void setShadowCompareMode(Texture.ShadowCompareMode compareMode)
compareMode
- the new ShadowCompareMode for this texture.java.lang.IllegalArgumentException
- if compareMode is nullTexture.ShadowCompareMode
public void setImage(Image image)
setImage
sets the image object that defines the texture.image
- the image that defines the texture.public void setKey(AssetKey key)
CloneableSmartAsset
AssetManager
to 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.setKey
in interface CloneableSmartAsset
key
- The texture key that was used to load this texturepublic AssetKey getKey()
CloneableSmartAsset
getKey
in interface CloneableSmartAsset
public Image getImage()
getImage
returns the image data that makes up this
texture. If no image data has been set, this will return null.public abstract void setWrap(Texture.WrapAxis axis, Texture.WrapMode mode)
setWrap
sets the wrap mode of this texture for a
particular axis.axis
- the texture axis to define a wrapmode on.mode
- the wrap mode for the given axis of the texture.java.lang.IllegalArgumentException
- if axis or mode are null or invalid for this type of texturepublic abstract void setWrap(Texture.WrapMode mode)
setWrap
sets the wrap mode of this texture for all axis.mode
- the wrap mode for the given axis of the texture.java.lang.IllegalArgumentException
- if mode is null or invalid for this type of texturepublic abstract Texture.WrapMode getWrap(Texture.WrapAxis axis)
getWrap
returns the wrap mode for a given coordinate axis
on this texture.axis
- the axis to return forjava.lang.IllegalArgumentException
- if axis is null or invalid for this type of texturepublic abstract Texture.Type getType()
public java.lang.String getName()
public void setName(java.lang.String name)
public int getAnisotropicFilter()
public void setAnisotropicFilter(int level)
level
- the anisotropic filtering level for this texture.public java.lang.String toString()
toString
in class java.lang.Object
public boolean equals(java.lang.Object obj)
equals
in class java.lang.Object
public int hashCode()
hashCode
in class java.lang.Object
@Deprecated public Texture createSimpleClone(Texture rVal)
clone()
instead.rVal
- storage for the clone (not null, modified)@Deprecated public abstract Texture createSimpleClone()
clone()
instead.public void write(JmeExporter e) throws java.io.IOException
public void read(JmeImporter e) throws java.io.IOException