public final class BlendTexture extends java.lang.Object implements Texture
BlendTexture
is a Texture
implementation that blends two other Texture
s together.
There is one restriction with this BlendTexture
class. None of the Texture
s to blend can be BlendTexture
s themselves. The renderer cannot currently handle multiple layers of blending. This restriction might be fixed in the
future.
Modifier and Type | Field and Description |
---|---|
static int |
RELATIVE_OFFSET_FACTOR
The relative offset of the Factor parameter in the
float array. |
static int |
RELATIVE_OFFSET_TEXTURE_A_OFFSET
The relative offset of the Texture A Offset parameter in the
float array. |
static int |
RELATIVE_OFFSET_TEXTURE_B_OFFSET
The relative offset of the Texture B Offset parameter in the
float array. |
static int |
SIZE
The size of a
BlendTexture in the float array. |
static int |
TYPE
The type number associated with a
BlendTexture . |
RELATIVE_OFFSET_SIZE, RELATIVE_OFFSET_TYPE
Constructor and Description |
---|
BlendTexture(Texture textureA,
Texture textureB)
Constructs a new
BlendTexture instance. |
BlendTexture(Texture textureA,
Texture textureB,
float factor)
Constructs a new
BlendTexture instance. |
Modifier and Type | Method and Description |
---|---|
boolean |
equals(java.lang.Object object)
Compares
object to this BlendTexture instance for equality. |
float |
getFactor()
Returns the blend factor.
|
int |
getSize()
Returns the size of this
BlendTexture instance. |
Texture |
getTextureA()
Returns the
Texture denoted by A . |
Texture |
getTextureB()
Returns the
Texture denoted by B . |
int |
getType()
Returns the type of this
BlendTexture instance. |
int |
hashCode()
Returns a hash code for this
BlendTexture instance. |
boolean |
isEmissive()
Returns
true if, and only if, this BlendTexture instance is emissive, false otherwise. |
float[] |
toArray()
Returns a
float array representation of this BlendTexture instance. |
java.lang.String |
toString()
Returns a
String representation of this BlendTexture instance. |
public static final int RELATIVE_OFFSET_TEXTURE_A_OFFSET
float
array. The value is 2
.public static final int RELATIVE_OFFSET_TEXTURE_B_OFFSET
float
array. The value is 3
.public static final int RELATIVE_OFFSET_FACTOR
float
array. The value is 4
.public static final int SIZE
BlendTexture
in the float
array. The size is 5
.public static final int TYPE
BlendTexture
. The number is 1
.public BlendTexture(Texture textureA, Texture textureB)
BlendTexture
instance.
Calling this constructor is equivalent to calling new BlendTexture(textureA, textureB, 0.5F)
.
If either textureA
or textureB
are null
, a NullPointerException
will be thrown.
If either textureA
or textureB
are BlendTexture
s, an IllegalArgumentException
will be thrown.
textureA
- a Texture
textureB
- a Texture
java.lang.IllegalArgumentException
- thrown if, and only if, either textureA
or textureB
are BlendTexture
sjava.lang.NullPointerException
- thrown if, and only if, either textureA
or textureB
are null
public BlendTexture(Texture textureA, Texture textureB, float factor)
BlendTexture
instance.
If either textureA
or textureB
are null
, a NullPointerException
will be thrown.
If either textureA
or textureB
are BlendTexture
s, an IllegalArgumentException
will be thrown.
textureA
- a Texture
textureB
- a Texture
factor
- the blend factorjava.lang.IllegalArgumentException
- thrown if, and only if, either textureA
or textureB
are BlendTexture
sjava.lang.NullPointerException
- thrown if, and only if, either textureA
or textureB
are null
public java.lang.String toString()
String
representation of this BlendTexture
instance.toString
in class java.lang.Object
String
representation of this BlendTexture
instancepublic Texture getTextureA()
Texture
denoted by A
.Texture
denoted by A
public Texture getTextureB()
Texture
denoted by B
.Texture
denoted by B
public boolean equals(java.lang.Object object)
object
to this BlendTexture
instance for equality.
Returns true
if, and only if, object
is an instance of BlendTexture
, and their respective values are equal, false
otherwise.
equals
in class java.lang.Object
object
- the Object
to compare to this BlendTexture
instance for equalitytrue
if, and only if, object
is an instance of BlendTexture
, and their respective values are equal, false
otherwisepublic boolean isEmissive()
true
if, and only if, this BlendTexture
instance is emissive, false
otherwise.isEmissive
in interface Texture
true
if, and only if, this BlendTexture
instance is emissive, false
otherwisepublic float getFactor()
public float[] toArray()
float
array representation of this BlendTexture
instance.public int getSize()
BlendTexture
instance.public int getType()
BlendTexture
instance.public int hashCode()
BlendTexture
instance.hashCode
in class java.lang.Object
BlendTexture
instance