Package javax.media.j3d
Class J3DBuffer
java.lang.Object
javax.media.j3d.J3DBuffer
Java 3D wrapper class for java.nio.Buffer objects.
When used to wrap a non-null NIO buffer object, this class will
create a read-only view of the wrapped NIO buffer, and will call
rewind
on the read-only view, so that elements 0
through buffer.limit()-1
will be available internally.- Since:
- Java 3D 1.3
- See Also:
-
GeometryArray.setCoordRefBuffer(J3DBuffer)
GeometryArray.setColorRefBuffer(J3DBuffer)
GeometryArray.setNormalRefBuffer(J3DBuffer)
GeometryArray.setTexCoordRefBuffer(int,J3DBuffer)
GeometryArray.setVertexAttrRefBuffer(int,J3DBuffer)
GeometryArray.setInterleavedVertexBuffer(J3DBuffer)
CompressedGeometry(CompressedGeometryHeader,J3DBuffer)
-
Constructor Summary
Constructors -
Method Summary
-
Constructor Details
-
J3DBuffer
public J3DBuffer()Constructs a J3DBuffer object and initializes it with a null NIO buffer object. The NIO buffer object must be set to a non-null value before using this J3DBuffer object in a Java 3D node component.- Throws:
UnsupportedOperationException
- if the JVM does not support native access to direct NIO buffers
-
J3DBuffer
Constructs a J3DBuffer object and initializes it with the specified NIO buffer object.- Parameters:
buffer
- the NIO buffer wrapped by this J3DBuffer- Throws:
UnsupportedOperationException
- if the JVM does not support native access to direct NIO buffersIllegalArgumentException
- if the specified buffer is not a direct buffer, or if the byte order of the specified buffer does not match the native byte order of the underlying platform.
-
-
Method Details
-
setBuffer
Sets the NIO buffer object in this J3DBuffer to the specified object.- Parameters:
buffer
- the NIO buffer wrapped by this J3DBuffer- Throws:
IllegalArgumentException
- if the specified buffer is not a direct buffer, or if the byte order of the specified buffer does not match the native byte order of the underlying platform.
-
getBuffer
Retrieves the NIO buffer object from this J3DBuffer.- Returns:
- the current NIO buffer wrapped by this J3DBuffer
-