public class J3DBuffer
extends java.lang.Object
rewind
on the read-only view, so that elements 0
through buffer.limit()-1
will be available internally.GeometryArray.setCoordRefBuffer(J3DBuffer)
,
GeometryArray.setColorRefBuffer(J3DBuffer)
,
GeometryArray.setNormalRefBuffer(J3DBuffer)
,
GeometryArray.setTexCoordRefBuffer(int,J3DBuffer)
,
GeometryArray.setVertexAttrRefBuffer(int,J3DBuffer)
,
GeometryArray.setInterleavedVertexBuffer(J3DBuffer)
,
CompressedGeometry.CompressedGeometry(CompressedGeometryHeader,J3DBuffer)
Modifier and Type | Class and Description |
---|---|
static class |
J3DBuffer.BufferType
Type of the wrapped NIO buffer object.
|
Constructor and Description |
---|
J3DBuffer()
Constructs a J3DBuffer object and initializes it with
a null NIO buffer object.
|
J3DBuffer(java.nio.Buffer buffer)
Constructs a J3DBuffer object and initializes it with
the specified NIO buffer object.
|
Modifier and Type | Method and Description |
---|---|
java.nio.Buffer |
getBuffer()
Retrieves the wrapped NIO buffer object from this J3DBuffer.
|
J3DBuffer.BufferType |
getBufferType()
Retrieves the type of the wrapped NIO buffer.
|
java.nio.ByteBuffer |
getByteBuffer()
Retrieves the read-only view of the wrapped NIO byte buffer.
|
java.nio.DoubleBuffer |
getDoubleBuffer()
Retrieves the read-only view of the wrapped NIO double buffer.
|
java.nio.FloatBuffer |
getFloatBuffer()
Retrieves the read-only view of the wrapped NIO float buffer.
|
void |
setBuffer(java.nio.Buffer buffer)
Sets the NIO buffer object in this J3DBuffer to
the specified object.
|
public J3DBuffer()
public J3DBuffer(java.nio.Buffer buffer)
buffer
- the NIO buffer wrapped by this J3DBufferjava.lang.IllegalArgumentException
- if the specified buffer is
neither of type ByteBuffer, DoubleBuffer, nor FloatBuffer, or
not a direct buffer, or if the byte order of the specified
buffer does not match the native byte order of the underlying
platform.public void setBuffer(java.nio.Buffer buffer)
buffer
- the NIO buffer wrapped by this J3DBufferjava.lang.IllegalArgumentException
- if the specified buffer is
neither of type ByteBuffer, DoubleBuffer, nor FloatBuffer, or
not a direct buffer, or if the byte order of the specified
buffer does not match the native byte order of the underlying
platform.public java.nio.Buffer getBuffer()
public java.nio.ByteBuffer getByteBuffer()
java.lang.ClassCastException
- if the wrapped buffer is not of type BufferType.BYTE
public java.nio.DoubleBuffer getDoubleBuffer()
java.lang.ClassCastException
- if the wrapped buffer is not of type BufferType.DOUBLE
public java.nio.FloatBuffer getFloatBuffer()
java.lang.ClassCastException
- if the wrapped buffer is not of type BufferType.FLOAT
public J3DBuffer.BufferType getBufferType()