public class IndexByteBuffer extends IndexBuffer
ByteBuffer
s.Constructor and Description |
---|
IndexByteBuffer(java.nio.ByteBuffer buffer) |
Modifier and Type | Method and Description |
---|---|
int |
get()
Returns the vertex index for the current position.
|
int |
get(int i)
Returns the vertex index for the given index in the index buffer.
|
java.nio.Buffer |
getBuffer()
Returns the underlying data-type specific
Buffer . |
VertexBuffer.Format |
getFormat()
Returns the format of the data stored in this buffer.
|
IndexByteBuffer |
put(int value)
Relative put method.
|
IndexByteBuffer |
put(int i,
int value)
Absolute put method.
|
int |
size()
Returns the size of the index buffer.
|
createIndexBuffer, remaining, rewind, wrapIndexBuffer
public int get()
IndexBuffer
get
in class IndexBuffer
public int get(int i)
IndexBuffer
get
in class IndexBuffer
i
- The index inside the index bufferpublic IndexByteBuffer put(int i, int value)
IndexBuffer
Puts the vertex index at the index buffer's index.
Implementations may throw an UnsupportedOperationException
if modifying the IndexBuffer is not supported (e.g. virtual index
buffers).
put
in class IndexBuffer
i
- The buffer indexvalue
- The vertex indexpublic IndexByteBuffer put(int value)
IndexBuffer
Puts the vertex index at the current position, then increments the
position. Implementations may throw an
UnsupportedOperationException
if modifying the IndexBuffer is not
supported (e.g. virtual index buffers).
put
in class IndexBuffer
value
- The vertex indexpublic int size()
IndexBuffer
size
in class IndexBuffer
public java.nio.Buffer getBuffer()
IndexBuffer
Buffer
.
Implementations may return null if there's no underlying
buffer.getBuffer
in class IndexBuffer
Buffer
.public VertexBuffer.Format getFormat()
IndexBuffer
This method can be used to set an IndexBuffer
to a
Mesh
:
mesh.setBuffer(Type.Index, 3, indexBuffer.getFormat(), indexBuffer);
getFormat
in class IndexBuffer