public final class BufferStructureBuilder
extends java.lang.Object
BufferStructure instances.
BufferStructureBuilder b = new BufferStructureBuilder();
b.createAccessorModel("indices accessor", indices, "SCALAR");
b.createArrayElementBufferViewModel("indices bufferView");
b.createAccessorModel("positions accessor", positions, "VEC3");
b.createAccessorModel("normals accessor", normals, "VEC3");
b.createArrayBufferViewModel("attributes bufferView");
b.createBufferModel("geometry buffer", "simpleTriangle.bin");
BufferStructure bufferStructure = b.build();
AccessorModel instance, these
instances will not be fully initialized until the build()
method is called.| Constructor and Description |
|---|
BufferStructureBuilder()
Default constructor
|
| Modifier and Type | Method and Description |
|---|---|
void |
addAccessorModel(java.lang.String idPrefix,
DefaultAccessorModel accessorModel)
Add the given
AccessorModel in the BufferStructure that
is currently being built. |
void |
addBufferModel(java.lang.String idPrefix,
DefaultBufferModel bufferModel)
Add the given
BufferModel in the BufferStructure
that is currently being built. |
void |
addBufferViewModel(java.lang.String idPrefix,
DefaultBufferViewModel bufferViewModel)
Add the given
BufferViewModel in the BufferStructure
that is currently being built. |
BufferStructure |
build()
Return the
BufferStructure instance that was created with
this builder. |
AccessorModel |
createAccessorModel(java.lang.String idPrefix,
byte[] data,
java.lang.String type)
Create an
AccessorModel in the BufferStructure that
is currently being built, using the component type
GL_UNSIGNED_BYTE |
AccessorModel |
createAccessorModel(java.lang.String idPrefix,
float[] data,
java.lang.String type)
Create an
AccessorModel in the BufferStructure that
is currently being built. |
AccessorModel |
createAccessorModel(java.lang.String idPrefix,
int[] data,
java.lang.String type)
Create an
AccessorModel in the BufferStructure that
is currently being built, using the component type
GL_UNSIGNED_INT |
AccessorModel |
createAccessorModel(java.lang.String idPrefix,
int componentType,
java.lang.String type,
java.nio.ByteBuffer byteBuffer)
Create an
AccessorModel in the BufferStructure that
is currently being built. |
AccessorModel |
createAccessorModel(java.lang.String idPrefix,
short[] data,
java.lang.String type)
Create an
AccessorModel in the BufferStructure that
is currently being built, using the component type
GL_UNSIGNED_SHORT |
BufferViewModel |
createArrayBufferViewModel(java.lang.String idPrefix)
Create a
BufferViewModel in the BufferStructure that
is currently being built. |
BufferViewModel |
createArrayElementBufferViewModel(java.lang.String idPrefix)
Create a
BufferViewModel in the BufferStructure that
is currently being built. |
BufferModel |
createBufferModel(java.lang.String idPrefix,
java.lang.String uri)
Create a
BufferModel in the BufferStructure that
is currently being built. |
BufferViewModel |
createBufferViewModel(java.lang.String idPrefix,
java.lang.Integer target)
Create a
BufferViewModel in the BufferStructure that
is currently being built. |
int |
getNumAccessorModels()
Returns the number of
AccessorModel instances that have
been created until now |
int |
getNumBufferModels()
Returns the number of
BufferModel instances that have
been created until now |
int |
getNumBufferViewModels()
Returns the number of
BufferViewModel instances that have
been created until now |
public int getNumAccessorModels()
AccessorModel instances that have
been created until nowAccessorModel instancespublic int getNumBufferViewModels()
BufferViewModel instances that have
been created until nowBufferViewModel instancespublic int getNumBufferModels()
BufferModel instances that have
been created until nowBufferModel instancespublic AccessorModel createAccessorModel(java.lang.String idPrefix, float[] data, java.lang.String type)
AccessorModel in the BufferStructure that
is currently being built.idPrefix - The ID prefix of the AccessorModeldata - The actual datatype - The type of the data, as a string corresponding to
the ElementType of the accessorAccessorModelpublic AccessorModel createAccessorModel(java.lang.String idPrefix, int[] data, java.lang.String type)
AccessorModel in the BufferStructure that
is currently being built, using the component type
GL_UNSIGNED_INTidPrefix - The ID prefix of the AccessorModeldata - The actual datatype - The type of the data, as a string corresponding to
the ElementType of the accessorAccessorModelpublic AccessorModel createAccessorModel(java.lang.String idPrefix, short[] data, java.lang.String type)
AccessorModel in the BufferStructure that
is currently being built, using the component type
GL_UNSIGNED_SHORTidPrefix - The ID prefix for the AccessorModeldata - The actual datatype - The type of the data, as a string corresponding to
the ElementType of the accessorAccessorModelpublic AccessorModel createAccessorModel(java.lang.String idPrefix, byte[] data, java.lang.String type)
AccessorModel in the BufferStructure that
is currently being built, using the component type
GL_UNSIGNED_BYTEidPrefix - The ID prefix for the AccessorModeldata - The actual datatype - The type of the data, as a string corresponding to
the ElementType of the accessorAccessorModelpublic AccessorModel createAccessorModel(java.lang.String idPrefix, int componentType, java.lang.String type, java.nio.ByteBuffer byteBuffer)
AccessorModel in the BufferStructure that
is currently being built.idPrefix - The ID prefix of the AccessorModelcomponentType - The component type, as a GL constanttype - The type of the data, as a string corresponding to
the ElementType of the accessorbyteBuffer - The actual dataAccessorModelpublic void addAccessorModel(java.lang.String idPrefix,
DefaultAccessorModel accessorModel)
AccessorModel in the BufferStructure that
is currently being built.idPrefix - The ID prefix of the AccessorModelaccessorModel - The AccessorModelpublic BufferViewModel createArrayBufferViewModel(java.lang.String idPrefix)
BufferViewModel in the BufferStructure that
is currently being built. The target will be the GL constant for GL_ARRAY_BUFFER.idPrefix - The ID prefix for the BufferViewModelBufferViewModelpublic BufferViewModel createArrayElementBufferViewModel(java.lang.String idPrefix)
BufferViewModel in the BufferStructure that
is currently being built. The target will be the GL constant for GL_ELEMENT_ARRAY_BUFFER.idPrefix - The ID prefix for the BufferViewModelBufferViewModelpublic BufferViewModel createBufferViewModel(java.lang.String idPrefix, java.lang.Integer target)
BufferViewModel in the BufferStructure that
is currently being built.idPrefix - The ID prefix for the BufferViewModeltarget - The BufferViewModel.getTarget()BufferViewModelpublic void addBufferViewModel(java.lang.String idPrefix,
DefaultBufferViewModel bufferViewModel)
BufferViewModel in the BufferStructure
that is currently being built. All AccessorModel instances
that have been created until now and not yet added to a
BufferViewModel will be assigned to the given model.idPrefix - The ID prefix for the BufferViewModelbufferViewModel - The BufferViewModel to addpublic BufferModel createBufferModel(java.lang.String idPrefix, java.lang.String uri)
BufferModel in the BufferStructure that
is currently being built.
If no buffer view models have been created (at all, or after
this method has previously been called), then this call will
not have any effect, and null will be returned.idPrefix - The ID prefix for the BufferModeluri - The BufferModel.getUri()BufferModelpublic void addBufferModel(java.lang.String idPrefix,
DefaultBufferModel bufferModel)
BufferModel in the BufferStructure
that is currently being built. All BufferViewModel instances
that have been created until now and not yet added to a
BufferModel will be assigned to the given model.idPrefix - The ID prefix for the BufferModelbufferModel - The BufferModelpublic BufferStructure build()
BufferStructure instance that was created with
this builder.BufferStructurejava.lang.IllegalStateException - If there are buffer views that have
not yet been combined into a bufferCopyright © 2022. All Rights Reserved.