org.jagatoo.loaders.models.cal3d.buffer
Class Vector3fBuffer

java.lang.Object
  extended by org.jagatoo.loaders.models.cal3d.buffer.Vector3fBuffer

public class Vector3fBuffer
extends java.lang.Object

Vector3fBuffer provides a wrapper to FloatBuffer for Vector3f. It is also the intended extension point for high-performance implementations of vector linear algebra.


Field Summary
protected  java.nio.FloatBuffer floatBuffer
           
 int length
           
static int STRIDE
           
 
Constructor Summary
Vector3fBuffer(java.nio.FloatBuffer floatBuffer, int length)
           
Vector3fBuffer(int length)
           
 
Method Summary
 void add(int n, org.openmali.vecmath2.Vector3f v)
           
 void clear()
          Sets all vectors to the zero vector.
 org.openmali.vecmath2.Vector3f get(int n)
           
 org.openmali.vecmath2.Vector3f get(int n, org.openmali.vecmath2.Vector3f v)
           
 java.nio.FloatBuffer getBuffer()
           
 float getX(int n)
           
 float getY(int n)
           
 float getZ(int n)
           
 void put(int n, float x, float y, float z)
           
 void put(int n, org.openmali.vecmath2.Vector3f v)
           
 void putX(int n, float x)
           
 void putY(int n, float y)
           
 void putZ(int n, float z)
           
 void scale(float xs, float ys, float zs)
          scale takes each vector and scales it in each dimension.
 void scale(int n, float v)
           
 void set(Vector3fBuffer v)
           
 int size()
           
 Vector3fBuffer slice(int offset, int length)
           
 void sub(int n, org.openmali.vecmath2.Vector3f v)
           
 void translate(float x, float y, float z)
          translate each vector.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

STRIDE

public static final int STRIDE
See Also:
Constant Field Values

floatBuffer

protected java.nio.FloatBuffer floatBuffer

length

public int length
Constructor Detail

Vector3fBuffer

public Vector3fBuffer(java.nio.FloatBuffer floatBuffer,
                      int length)

Vector3fBuffer

public Vector3fBuffer(int length)
Method Detail

set

public void set(Vector3fBuffer v)

put

public void put(int n,
                float x,
                float y,
                float z)

put

public void put(int n,
                org.openmali.vecmath2.Vector3f v)

putX

public void putX(int n,
                 float x)

putY

public void putY(int n,
                 float y)

putZ

public void putZ(int n,
                 float z)

get

public org.openmali.vecmath2.Vector3f get(int n)

get

public org.openmali.vecmath2.Vector3f get(int n,
                                          org.openmali.vecmath2.Vector3f v)

getX

public float getX(int n)

getY

public float getY(int n)

getZ

public float getZ(int n)

add

public void add(int n,
                org.openmali.vecmath2.Vector3f v)

sub

public void sub(int n,
                org.openmali.vecmath2.Vector3f v)

scale

public void scale(int n,
                  float v)

slice

public Vector3fBuffer slice(int offset,
                            int length)

getBuffer

public java.nio.FloatBuffer getBuffer()

clear

public void clear()
Sets all vectors to the zero vector.


size

public int size()

translate

public void translate(float x,
                      float y,
                      float z)
translate each vector. This is vectorisable!


scale

public void scale(float xs,
                  float ys,
                  float zs)
scale takes each vector and scales it in each dimension. This is vectorisable!