Package com.jme3.scene.mesh
Class IndexBuffer
java.lang.Object
com.jme3.scene.mesh.IndexBuffer
- Direct Known Subclasses:
- IndexByteBuffer,- IndexIntBuffer,- IndexShortBuffer,- VirtualIndexBuffer
IndexBuffer is an abstraction for integer index buffers,
 it is used to retrieve indices without knowing in which format they 
 are stored (ushort or uint).- 
Constructor SummaryConstructors
- 
Method SummaryModifier and TypeMethodDescriptionstatic IndexBuffercreateIndexBuffer(int vertexCount, int indexCount) Create an IndexBuffer with the specified capacity.abstract intget()Returns the vertex index for the current position.abstract intget(int i) Returns the vertex index for the given index in the index buffer.abstract BufferReturns the underlying data-type specificBuffer.abstract VertexBuffer.FormatReturns the format of the data stored in this buffer.abstract IndexBufferput(int value) Relative put method.abstract IndexBufferput(int i, int value) Absolute put method.intvoidrewind()abstract intsize()Returns the size of the index buffer.static IndexBufferwrapIndexBuffer(Buffer buf) 
- 
Constructor Details- 
IndexBufferpublic IndexBuffer()
 
- 
- 
Method Details- 
wrapIndexBuffer
- 
createIndexBufferCreate an IndexBuffer with the specified capacity.- Parameters:
- vertexCount- the number of vertices that will be indexed into (determines number of bits per element)
- indexCount- the number of indices the IndexBuffer must hold (determines number of elements in the buffer)
- Returns:
- a new, appropriately sized IndexBuffer, which may be an
 IndexByteBuffer, anIndexShortBuffer, or anIndexIntBuffer
 
- 
rewindpublic void rewind()- See Also:
 
- 
remainingpublic int remaining()- Returns:
- the count (≥0)
- See Also:
 
- 
getpublic abstract int get()Returns the vertex index for the current position.- Returns:
- the index
 
- 
getpublic abstract int get(int i) Returns the vertex index for the given index in the index buffer.- Parameters:
- i- The index inside the index buffer
- Returns:
- the index
 
- 
putAbsolute put method.Puts the vertex index at the index buffer's index. Implementations may throw an UnsupportedOperationExceptionif modifying the IndexBuffer is not supported (e.g. virtual index buffers).- Parameters:
- i- The buffer index
- value- The vertex index
- Returns:
- This buffer
 
- 
putRelative put method.Puts the vertex index at the current position, then increments the position. Implementations may throw an UnsupportedOperationExceptionif modifying the IndexBuffer is not supported (e.g. virtual index buffers).- Parameters:
- value- The vertex index
- Returns:
- This buffer
 
- 
sizepublic abstract int size()Returns the size of the index buffer.- Returns:
- the size of the index buffer.
 
- 
getBufferReturns the underlying data-type specificBuffer. Implementations may return null if there's no underlying buffer.- Returns:
- the underlying Buffer.
 
- 
getFormatReturns the format of the data stored in this buffer.This method can be used to set an IndexBufferto aMesh:mesh.setBuffer(Type.Index, 3, indexBuffer.getFormat(), indexBuffer);- Returns:
- an enum value
 
 
-