net.java.dev.joode.util
Class Real

java.lang.Object
  extended by net.java.dev.joode.util.Real
Direct Known Subclasses:
Matrix, Vector3, Vector4

public class Real
extends java.lang.Object


Field Summary
 float[] m
           
 
Constructor Summary
Real(float[] array)
          Deprecated. use the pool methods: aquire instance and release instance instead
Real(int size)
          Deprecated. use the pool methods: aquire instance and release instance instead
 
Method Summary
 Real add(Real a)
           
static Real aquireDirtyInstance(int size)
          returns a real from the pooled instances, the real that is returned is not zeroed, so should only be used where the contents are about to be overwritten.
static Real aquireInstance(int size)
          returns a real from the pooled instances, the real that is returned is zeroed, so is identical to instanciation by the constructor Real(int size).
 float dot(Real a)
           
 float dot(RealPointer a)
           
static boolean epsilonEquals(float a, float b, float e)
           
static boolean epsilonEquals(Real a, Real b, float e)
           
 void fill(float value)
           
 float get(int index)
           
 float length()
           
 float lengthSquared()
           
 float max()
          returns the maximum value among the components
 float min()
          returns the minumum value among the components
 float norm()
           
 void normalize()
           
static void releaseInstance(Real instance)
          releases the instance of the Real back into the object pool.
 void scale(float scale)
           
 void set(int index, float value)
           
 void set(Real other)
           
 void setZero()
           
 int size()
           
 Real sub(Real a)
           
 java.lang.String toString()
           
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, wait, wait, wait
 

Field Detail

m

public final float[] m
Constructor Detail

Real

public Real(int size)
Deprecated. use the pool methods: aquire instance and release instance instead

Parameters:
size -

Real

public Real(float[] array)
Deprecated. use the pool methods: aquire instance and release instance instead

Method Detail

aquireInstance

public static Real aquireInstance(int size)
returns a real from the pooled instances, the real that is returned is zeroed, so is identical to instanciation by the constructor Real(int size). Remember to return the instance back to the pool with releaseInstance

Parameters:
size -
Returns:

aquireDirtyInstance

public static Real aquireDirtyInstance(int size)
returns a real from the pooled instances, the real that is returned is not zeroed, so should only be used where the contents are about to be overwritten. Rememeber to return the instance back to the pool with releaseInstance

Parameters:
size -
Returns:

releaseInstance

public static void releaseInstance(Real instance)
releases the instance of the Real back into the object pool.

Parameters:
instance -

size

public int size()

get

public float get(int index)

set

public void set(Real other)

setZero

public void setZero()

fill

public void fill(float value)

add

public Real add(Real a)

sub

public Real sub(Real a)
Parameters:
a -
Returns:
this

scale

public void scale(float scale)

dot

public float dot(Real a)

dot

public float dot(RealPointer a)

norm

public float norm()

normalize

public void normalize()

length

public float length()

lengthSquared

public float lengthSquared()

min

public float min()
returns the minumum value among the components

Returns:

max

public float max()
returns the maximum value among the components

Returns:

toString

public java.lang.String toString()
Overrides:
toString in class java.lang.Object

epsilonEquals

public static boolean epsilonEquals(Real a,
                                    Real b,
                                    float e)

set

public void set(int index,
                float value)

epsilonEquals

public static boolean epsilonEquals(float a,
                                    float b,
                                    float e)