Package com.ardor3d.scenegraph
Class IndexBufferData<T extends Buffer>
java.lang.Object
com.ardor3d.scenegraph.AbstractBufferData<T>
com.ardor3d.scenegraph.IndexBufferData<T>
- Direct Known Subclasses:
ByteBufferData
,IntBufferData
,ShortBufferData
-
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
-
Method Summary
Modifier and TypeMethodDescriptionabstract IntBuffer
int
capacity()
void
clear()
void
flip()
abstract int
get()
abstract int
get
(int index) abstract T
Get the underlying nio buffer.int
limit()
void
limit
(int limit) abstract IndexBufferData
<T> makeCopy()
int
position()
void
position
(int position) abstract IndexBufferData
<T> put
(int value) Sets the value of this buffer at the current position, incrementing our position by 1 entry.abstract void
put
(int[] array) Write the contents of the given int array into this IndexBufferData.abstract void
put
(int[] array, int offset, int length) Write the contents of the given int array into this IndexBufferData.abstract IndexBufferData
<T> put
(int index, int value) Sets the value of this buffer at the given index.abstract void
put
(IndexBufferData<?> buf) Write the contents of the given IndexBufferData into this one.int
void
reset()
void
rewind()
Methods inherited from class com.ardor3d.scenegraph.AbstractBufferData
cleanAllVBOs, cleanAllVBOs, cleanExpiredVBOs, getBufferCapacity, getBufferLimit, getByteCount, getVboAccessMode, getVBOID, isNeedsRefresh, read, removeVBOID, setBuffer, setNeedsRefresh, setVboAccessMode, setVBOID, write
-
Constructor Details
-
IndexBufferData
public IndexBufferData()
-
-
Method Details
-
get
public abstract int get()- Returns:
- the next value from this object, as an int, incrementing our position by 1 entry. Buffer types smaller than an int should return unsigned values.
-
get
public abstract int get(int index) - Parameters:
index
- the absolute position to get our value from. This is in entries, not bytes, and is 0 based. So for a ShortBuffer, 2 would be the 3rd short from the beginning, etc.- Returns:
- the value from this object, as an int, at the given absolute entry position. Buffer types smaller than an int should return unsigned values.
-
asIntBuffer
- Returns:
- a new, non-direct IntBuffer containing a snapshot of the contents of this buffer.
-
put
Sets the value of this buffer at the current position, incrementing our position by 1 entry.- Parameters:
value
- the value to place into this object at the current position.- Returns:
- this object, for chaining.
-
put
Sets the value of this buffer at the given index.- Parameters:
index
- the absolute position to put our value at. This is in entries, not bytes, and is 0 based. So for a ShortBuffer, 2 would be the 3rd short from the beginning, etc.value
- the value to place into this object- Returns:
- this object, for chaining.
-
put
Write the contents of the given IndexBufferData into this one. Note that data conversion is handled using the get/put methods in IndexBufferData.- Parameters:
buf
- the source buffer object.
-
put
public abstract void put(int[] array) Write the contents of the given int array into this IndexBufferData. Note that data conversion is handled using the get/put methods in IndexBufferData.- Parameters:
array
- the source int array.
-
put
public abstract void put(int[] array, int offset, int length) Write the contents of the given int array into this IndexBufferData. Note that data conversion is handled using the get/put methods in IndexBufferData.- Parameters:
array
- the source int array.offset
- the offsetlength
- the length
-
getBuffer
Get the underlying nio buffer.- Overrides:
getBuffer
in classAbstractBufferData<T extends Buffer>
- Returns:
- the buffer
-
remaining
public int remaining()- Returns:
- The number of elements remaining in this buffer
- See Also:
-
position
public int position()- Returns:
- The position of this buffer
- See Also:
-
position
public void position(int position) - Parameters:
position
- The new position value; must be non-negative and no larger than the current limit- See Also:
-
limit
public int limit()- Returns:
- The limit of this buffer
- See Also:
-
limit
public void limit(int limit) - Parameters:
limit
- The new limit value; must be non-negative and no larger than this buffer's capacity- See Also:
-
capacity
public int capacity()- Returns:
- The capacity of this buffer
- See Also:
-
rewind
public void rewind()- See Also:
-
flip
public void flip()- See Also:
-
clear
public void clear()- See Also:
-
reset
public void reset()- See Also:
-
makeCopy
- Specified by:
makeCopy
in classAbstractBufferData<T extends Buffer>
- Returns:
- a deep copy of this buffer data object
-