Package com.ardor3d.scenegraph
Class FloatBufferData
- All Implemented Interfaces:
Savable
Simple data class storing a buffer of floats and a number that indicates how many floats to group together to make up
a "tuple"
-
Nested Class Summary
Nested classes/interfaces inherited from class com.ardor3d.scenegraph.AbstractBufferData
AbstractBufferData.VBOAccessMode
-
Field Summary
Fields inherited from class com.ardor3d.scenegraph.AbstractBufferData
_buffer, _needsRefresh, _vboAccessMode, _vboIdCache
-
Constructor Summary
ConstructorDescriptionInstantiates a new FloatBufferData.FloatBufferData
(int size, int valuesPerTuple) Instantiates a new FloatBufferData with a buffer of the given size.FloatBufferData
(FloatBuffer buffer, int valuesPerTuple) Creates a new FloatBufferData. -
Method Summary
Modifier and TypeMethodDescriptionint
Class
<? extends FloatBufferData> int
int
makeCopy()
void
read
(InputCapsule capsule) void
scaleData
(float... scales) Scale the data in this buffer by the given value(s)void
translateData
(float... translates) Translate the data in this buffer by the given value(s)void
write
(OutputCapsule capsule) Methods inherited from class com.ardor3d.scenegraph.AbstractBufferData
cleanAllVBOs, cleanAllVBOs, cleanExpiredVBOs, getBuffer, getBufferCapacity, getBufferLimit, getVboAccessMode, getVBOID, isNeedsRefresh, removeVBOID, setBuffer, setNeedsRefresh, setVboAccessMode, setVBOID
-
Constructor Details
-
FloatBufferData
public FloatBufferData()Instantiates a new FloatBufferData. -
FloatBufferData
public FloatBufferData(int size, int valuesPerTuple) Instantiates a new FloatBufferData with a buffer of the given size.- Parameters:
size
- the sizevaluesPerTuple
- Specifies the number of values per tuple. Can not be < 1.
-
FloatBufferData
Creates a new FloatBufferData.- Parameters:
buffer
- Buffer holding the data. Must not be null.valuesPerTuple
- Specifies the number of values per tuple. Can not be < 1.
-
-
Method Details
-
getByteCount
public int getByteCount()- Specified by:
getByteCount
in classAbstractBufferData<FloatBuffer>
- Returns:
- the number of bytes per entry in the buffer. For example, an IntBuffer would return 4.
-
getTupleCount
public int getTupleCount() -
getValuesPerTuple
public int getValuesPerTuple()- Returns:
- number of values per tuple
-
scaleData
public void scaleData(float... scales) Scale the data in this buffer by the given value(s)- Parameters:
scales
- the scale values to use. The Nth buffer element is scaled by the (N % scales.length) scales element.
-
translateData
public void translateData(float... translates) Translate the data in this buffer by the given value(s)- Parameters:
translates
- the translation values to use. The Nth buffer element is translated by the (N % translates.length) translates element.
-
makeCopy
- Specified by:
makeCopy
in classAbstractBufferData<FloatBuffer>
- Returns:
- a deep copy of this buffer data object
-
getClassTag
- Specified by:
getClassTag
in interfaceSavable
-
read
- Specified by:
read
in interfaceSavable
- Overrides:
read
in classAbstractBufferData<FloatBuffer>
- Throws:
IOException
-
write
- Specified by:
write
in interfaceSavable
- Overrides:
write
in classAbstractBufferData<FloatBuffer>
- Throws:
IOException
-