org.openmali.vecmath2
Class TexCoord4f

java.lang.Object
  extended by org.openmali.vecmath2.TexCoordf<TexCoord4f>
      extended by org.openmali.vecmath2.TexCoord4f
All Implemented Interfaces:
java.io.Externalizable, java.io.Serializable

public class TexCoord4f
extends TexCoordf<TexCoord4f>
implements java.io.Externalizable

A simple Texture-Coordinate implementation for 4 values.
The order is (s, t, r, q).

See Also:
Serialized Form

Field Summary
 
Fields inherited from class org.openmali.vecmath2.TexCoordf
isDirty, N, roTrick, values
 
Constructor Summary
  TexCoord4f()
          Creates a new TexCoord4f instance.
protected TexCoord4f(boolean readOnly)
          Creates a new TexCoord4f instance.
protected TexCoord4f(boolean readOnly, float[] values)
          Creates a new TexCoord4f instance.
protected TexCoord4f(boolean readOnly, float s, float t, float p, float q)
          Creates a new TexCoord4f instance.
protected TexCoord4f(boolean readOnly, TexCoord4f texCoord)
          Creates a new TexCoord4f instance.
  TexCoord4f(float[] values)
          Creates a new TexCoord4f instance.
  TexCoord4f(float s, float t, float p, float q)
          Creates a new TexCoord4f instance.
  TexCoord4f(TexCoord4f texCoord)
          Creates a new TexCoord4f instance.
 
Method Summary
 TexCoord4f add(float s, float t, float p, float q)
          Adds the given parameters to this tuple's values.
 TexCoord4f addP(float v)
          Adds v to this texCoord's P value.
 TexCoord4f addQ(float v)
          Adds v to this texCoord's Q value.
 TexCoord4f addS(float v)
          Adds v to this texCoord's S value.
 TexCoord4f addT(float v)
          Adds v to this texCoord's T value.
 TexCoord4f clone()
          Creates and returns a copy of this object.
 TexCoord4f div(float vs, float vt, float vp, float vq)
          Divides this texCoord's values by vs, vt, vp, vq.
 TexCoord4f divP(float v)
          Divides this texCoord's P value by v.
 TexCoord4f divQ(float v)
          Divides this texCoord's Q value by v.
 TexCoord4f divS(float v)
          Divides this texCoord's S value by v.
 TexCoord4f divT(float v)
          Divides this texCoord's T value by v.
 boolean equals(java.lang.Object o)
          Returns true if the Object t1 is of type Tuple3f and all of the data members of t1 are equal to the corresponding data members in this Tuple3f.
static TexCoord4f fromPool()
          Allocates an TexCoord4f instance from the pool.
static TexCoord4f fromPool(float s, float t, float p, float q)
          Allocates an TexCoord4f instance from the pool.
 float getP()
           
 float getQ()
           
 float getS()
           
 float getT()
           
 TexCoord4f mul(float factor)
          Sets the value of this tuple to the scalar multiplication of itself.
 TexCoord4f mul(float vs, float vt, float vp, float vq)
          Multiplies this texCoord's values with vs, vt, vp, vq.
 TexCoord4f mulP(float v)
          Multiplies this texCoord's P value with v.
 TexCoord4f mulQ(float v)
          Multiplies this texCoord's Q value with v.
 TexCoord4f mulS(float v)
          Multiplies this texCoord's S value with v.
 TexCoord4f mulT(float v)
          Multiplies this texCoord's T value with v.
static TexCoord4f newReadOnly(float[] values)
          Creates a new TexCoord4f instance.
static TexCoord4f newReadOnly(float s, float t, float p, float q)
          Creates a new TexCoord4f instance.
static TexCoord4f newReadOnly(TexCoord4f texCoord)
          Creates a new TexCoord4f instance.
 float p()
           
 TexCoord4f p(float p)
          Sets the P (3rd) texCoord component.
 float q()
           
 TexCoord4f q(float q)
          Sets the Q (4th) texCoord component.
 float s()
           
 TexCoord4f s(float s)
          Sets the S (1st) texCoord component.
 TexCoord4f set(float s, float t, float p, float q)
          Sets all values of this texCoord to the specified ones.
 TexCoord4f setP(float p)
          Sets the P (3rd) texCoord component.
 TexCoord4f setQ(float q)
          Sets the Q (4th) texCoord component.
 TexCoord4f setS(float s)
          Sets the S (1st) texCoord component.
 TexCoord4f setT(float t)
          Sets the T (2nd) texCoord component.
 TexCoord4f sub(float s, float t, float p, float q)
          Subtracts the given parameters from this tuple's values.
 TexCoord4f subP(float v)
          Subtracts v from this texCoord's P value.
 TexCoord4f subQ(float v)
          Subtracts v from this texCoord's Q value.
 TexCoord4f subS(float v)
          Subtracts v from this texCoord's S value.
 TexCoord4f subT(float v)
          Subtracts v from this texCoord's T value.
 float t()
           
 TexCoord4f t(float t)
          Sets the T (2nd) texCoord component.
static void toPool(TexCoord4f o)
          Stores the given TexCoord4f instance in the pool.
 
Methods inherited from class org.openmali.vecmath2.TexCoordf
add, add, clamp, clamp, clampMax, clampMax, clampMin, clampMin, deserialize, epsilonEquals, equals, get, get, get, getSerializationBufferSize, getSize, hashCode, interpolate, interpolate, isDirty, isReadOnly, newArray, readExternal, readFromBuffer, readFromBuffer, readFromBuffer, readFromBuffer, scaleAdd, scaleAdd, serialize, set, set, set, setClean, setZero, sub, sub, toString, writeExternal, writeToBuffer, writeToBuffer, writeToBuffer, writeToBuffer
 
Methods inherited from class java.lang.Object
finalize, getClass, notify, notifyAll, wait, wait, wait
 
Methods inherited from interface java.io.Externalizable
readExternal, writeExternal
 

Constructor Detail

TexCoord4f

protected TexCoord4f(boolean readOnly,
                     float s,
                     float t,
                     float p,
                     float q)
Creates a new TexCoord4f instance.

Parameters:
readOnly -
s - the S element to use
t - the T element to use
p - the P element to use
q - the Q channel to use

TexCoord4f

protected TexCoord4f(boolean readOnly,
                     float[] values)
Creates a new TexCoord4f instance.

Parameters:
readOnly -
values - the values array (must be at least size 4)

TexCoord4f

protected TexCoord4f(boolean readOnly,
                     TexCoord4f texCoord)
Creates a new TexCoord4f instance.

Parameters:
readOnly -
texCoord - the TexCoordf to copy the values from

TexCoord4f

protected TexCoord4f(boolean readOnly)
Creates a new TexCoord4f instance.

Parameters:
readOnly -

TexCoord4f

public TexCoord4f(float s,
                  float t,
                  float p,
                  float q)
Creates a new TexCoord4f instance.

Parameters:
s - the S element to use
t - the T element to use
p - the P element to use
q - the Q channel to use

TexCoord4f

public TexCoord4f(float[] values)
Creates a new TexCoord4f instance.

Parameters:
values - the values array (must be at least size 4)

TexCoord4f

public TexCoord4f(TexCoord4f texCoord)
Creates a new TexCoord4f instance.

Parameters:
texCoord - the TexCoordf to copy the values from

TexCoord4f

public TexCoord4f()
Creates a new TexCoord4f instance.

Method Detail

set

public final TexCoord4f set(float s,
                            float t,
                            float p,
                            float q)
Sets all values of this texCoord to the specified ones.

Parameters:
s - the s element to use
t - the t element to use
p - the P element to use
q - the q element to use
Returns:
itself

setS

public final TexCoord4f setS(float s)
Sets the S (1st) texCoord component.

Parameters:
s -
Returns:
itself

getS

public final float getS()
Returns:
the S (1st) texCoord component.

s

public final TexCoord4f s(float s)
Sets the S (1st) texCoord component.

Parameters:
s -
Returns:
itself

s

public final float s()
Returns:
the S (1st) texCoord component.

setT

public final TexCoord4f setT(float t)
Sets the T (2nd) texCoord component.

Parameters:
t -
Returns:
itself

getT

public final float getT()
Returns:
the T (2nd) texCoord component.

t

public final TexCoord4f t(float t)
Sets the T (2nd) texCoord component.

Parameters:
t -
Returns:
itself

t

public final float t()
Returns:
the T (2nd) texCoord component.

setP

public final TexCoord4f setP(float p)
Sets the P (3rd) texCoord component.

Parameters:
p -
Returns:
itself

getP

public final float getP()
Returns:
the P (3rd) texCoord component.

p

public final TexCoord4f p(float p)
Sets the P (3rd) texCoord component.

Parameters:
p -
Returns:
itself

p

public final float p()
Returns:
the P (3rd) texCoord component.

setQ

public final TexCoord4f setQ(float q)
Sets the Q (4th) texCoord component.

Parameters:
q -
Returns:
itself

getQ

public final float getQ()
Returns:
the Q (4th) texCoord component.

q

public final TexCoord4f q(float q)
Sets the Q (4th) texCoord component.

Parameters:
q -
Returns:
itself

q

public final float q()
Returns:
the Q (4th) texCoord component.

addS

public final TexCoord4f addS(float v)
Adds v to this texCoord's S value.

Parameters:
v -
Returns:
itself

addT

public final TexCoord4f addT(float v)
Adds v to this texCoord's T value.

Parameters:
v -
Returns:
itself

addP

public final TexCoord4f addP(float v)
Adds v to this texCoord's P value.

Parameters:
v -
Returns:
itself

addQ

public final TexCoord4f addQ(float v)
Adds v to this texCoord's Q value.

Parameters:
v -
Returns:
itself

subS

public final TexCoord4f subS(float v)
Subtracts v from this texCoord's S value.

Parameters:
v -
Returns:
itself

subT

public final TexCoord4f subT(float v)
Subtracts v from this texCoord's T value.

Parameters:
v -
Returns:
itself

subP

public final TexCoord4f subP(float v)
Subtracts v from this texCoord's P value.

Parameters:
v -
Returns:
itself

subQ

public final TexCoord4f subQ(float v)
Subtracts v from this texCoord's Q value.

Parameters:
v -
Returns:
itself

mulS

public final TexCoord4f mulS(float v)
Multiplies this texCoord's S value with v.

Parameters:
v -
Returns:
itself

mulT

public final TexCoord4f mulT(float v)
Multiplies this texCoord's T value with v.

Parameters:
v -
Returns:
itself

mulP

public final TexCoord4f mulP(float v)
Multiplies this texCoord's P value with v.

Parameters:
v -
Returns:
itself

mulQ

public final TexCoord4f mulQ(float v)
Multiplies this texCoord's Q value with v.

Parameters:
v -
Returns:
itself

mul

public final TexCoord4f mul(float vs,
                            float vt,
                            float vp,
                            float vq)
Multiplies this texCoord's values with vs, vt, vp, vq.

Parameters:
vs -
vt -
vp -
vq -
Returns:
itself

mul

public final TexCoord4f mul(float factor)
Sets the value of this tuple to the scalar multiplication of itself.

Parameters:
factor - the scalar value
Returns:
itself

divS

public final TexCoord4f divS(float v)
Divides this texCoord's S value by v.

Parameters:
v -
Returns:
itself

divT

public final TexCoord4f divT(float v)
Divides this texCoord's T value by v.

Parameters:
v -
Returns:
itself

divP

public final TexCoord4f divP(float v)
Divides this texCoord's P value by v.

Parameters:
v -
Returns:
itself

divQ

public final TexCoord4f divQ(float v)
Divides this texCoord's Q value by v.

Parameters:
v -
Returns:
itself

div

public final TexCoord4f div(float vs,
                            float vt,
                            float vp,
                            float vq)
Divides this texCoord's values by vs, vt, vp, vq.

Parameters:
vs -
vt -
vp -
vq -
Returns:
itself

add

public final TexCoord4f add(float s,
                            float t,
                            float p,
                            float q)
Adds the given parameters to this tuple's values.

Parameters:
s -
t -
p -
q -
Returns:
itself

sub

public final TexCoord4f sub(float s,
                            float t,
                            float p,
                            float q)
Subtracts the given parameters from this tuple's values.

Parameters:
s -
t -
p -
q -
Returns:
itself

equals

public boolean equals(java.lang.Object o)
Returns true if the Object t1 is of type Tuple3f and all of the data members of t1 are equal to the corresponding data members in this Tuple3f.

Overrides:
equals in class TexCoordf<TexCoord4f>
Parameters:
o - the Object with which the comparison is made
Returns:
true or false

clone

public TexCoord4f clone()
Creates and returns a copy of this object.

Overrides:
clone in class java.lang.Object
Returns:
a clone of this instance.
Throws:
java.lang.OutOfMemoryError - if there is not enough memory.
See Also:
Cloneable

newReadOnly

public static final TexCoord4f newReadOnly(float s,
                                           float t,
                                           float p,
                                           float q)
Creates a new TexCoord4f instance.

Parameters:
s - the S element to use
t - the T element to use
p - the P element to use
q - the Q channel to use

newReadOnly

public static final TexCoord4f newReadOnly(float[] values)
Creates a new TexCoord4f instance.

Parameters:
values - the values array (must be at least size 4)

newReadOnly

public static final TexCoord4f newReadOnly(TexCoord4f texCoord)
Creates a new TexCoord4f instance.

Parameters:
texCoord - the TexCoordf to copy the values from

fromPool

public static TexCoord4f fromPool()
Allocates an TexCoord4f instance from the pool.


fromPool

public static TexCoord4f fromPool(float s,
                                  float t,
                                  float p,
                                  float q)
Allocates an TexCoord4f instance from the pool.

Parameters:
s - the S element to use
t - the T element to use
p - the P element to use
q - the Q channel to use

toPool

public static void toPool(TexCoord4f o)
Stores the given TexCoord4f instance in the pool.

Parameters:
o -