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
ConstructorsConstructorDescriptionInstantiates 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 TypeMethodDescriptionintClass<? extends FloatBufferData> intintmakeCopy()voidread(InputCapsule capsule) voidscaleData(float... scales) Scale the data in this buffer by the given value(s)voidtranslateData(float... translates) Translate the data in this buffer by the given value(s)voidwrite(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:
getByteCountin 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:
makeCopyin classAbstractBufferData<FloatBuffer>- Returns:
- a deep copy of this buffer data object
-
getClassTag
- Specified by:
getClassTagin interfaceSavable
-
read
- Specified by:
readin interfaceSavable- Overrides:
readin classAbstractBufferData<FloatBuffer>- Throws:
IOException
-
write
- Specified by:
writein interfaceSavable- Overrides:
writein classAbstractBufferData<FloatBuffer>- Throws:
IOException
-