Package org.lwjgl.util.meshoptimizer
Class MeshoptMeshlet
java.lang.Object
org.lwjgl.system.Pointer.Default
org.lwjgl.system.Struct<MeshoptMeshlet>
org.lwjgl.util.meshoptimizer.MeshoptMeshlet
- All Implemented Interfaces:
AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class MeshoptMeshlet
extends org.lwjgl.system.Struct<MeshoptMeshlet>
implements org.lwjgl.system.NativeResource
Meshlet is a small mesh cluster (subset) that consists of:
- triangles, an 8-bit micro triangle (index) buffer, that for each triangle specifies three local vertices to use;
- vertices, a 32-bit vertex indirection buffer, that for each local vertex specifies which mesh vertex to fetch vertex attributes from.
For efficiency, meshlet triangles and vertices are packed into two large arrays; this structure contains offsets and counts to access the data.
Layout
struct meshopt_Meshlet {
unsigned int vertex_offset();
unsigned int triangle_offset();
unsigned int vertex_count();
unsigned int triangle_count();
}-
Nested Class Summary
Nested ClassesNested classes/interfaces inherited from class org.lwjgl.system.Struct
org.lwjgl.system.Struct.StructValidationNested classes/interfaces inherited from interface org.lwjgl.system.Pointer
org.lwjgl.system.Pointer.Default -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final intThe struct alignment in bytes.static final intThe struct size in bytes.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.static final intThe struct member offsets.Fields inherited from interface org.lwjgl.system.Pointer
BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE -
Constructor Summary
ConstructorsConstructorDescriptionMeshoptMeshlet(ByteBuffer container) Creates aMeshoptMeshletinstance at the current position of the specifiedByteBuffercontainer. -
Method Summary
Modifier and TypeMethodDescriptionstatic MeshoptMeshletcalloc()Returns a newMeshoptMeshletinstance allocated withmemCalloc.static MeshoptMeshlet.Buffercalloc(int capacity) Returns a newMeshoptMeshlet.Bufferinstance allocated withmemCalloc.static MeshoptMeshlet.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newMeshoptMeshlet.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static MeshoptMeshletcalloc(org.lwjgl.system.MemoryStack stack) Returns a newMeshoptMeshletinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static MeshoptMeshletcreate()Returns a newMeshoptMeshletinstance allocated withBufferUtils.static MeshoptMeshlet.Buffercreate(int capacity) Returns a newMeshoptMeshlet.Bufferinstance allocated withBufferUtils.static MeshoptMeshletcreate(long address) Returns a newMeshoptMeshletinstance for the specified memory address.static MeshoptMeshlet.Buffercreate(long address, int capacity) Create aMeshoptMeshlet.Bufferinstance at the specified memory.static @Nullable MeshoptMeshletcreateSafe(long address) static @Nullable MeshoptMeshlet.BuffercreateSafe(long address, int capacity) static MeshoptMeshletmalloc()Returns a newMeshoptMeshletinstance allocated withmemAlloc.static MeshoptMeshlet.Buffermalloc(int capacity) Returns a newMeshoptMeshlet.Bufferinstance allocated withmemAlloc.static MeshoptMeshlet.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack) Returns a newMeshoptMeshlet.Bufferinstance allocated on the specifiedMemoryStack.static MeshoptMeshletmalloc(org.lwjgl.system.MemoryStack stack) Returns a newMeshoptMeshletinstance allocated on the specifiedMemoryStack.static intntriangle_count(long struct) Unsafe version oftriangle_count().static intntriangle_offset(long struct) Unsafe version oftriangle_offset().static intnvertex_count(long struct) Unsafe version ofvertex_count().static intnvertex_offset(long struct) Unsafe version ofvertex_offset().intsizeof()intnumber of triangles used in the meshlet; data is stored in consecutive range defined by offset and countintoffset withinmeshlet_trianglesarray with meshlet dataintnumber of vertices used in the meshlet; data is stored in consecutive range defined by offset and countintoffset withinmeshlet_verticesarray with meshlet dataMethods inherited from class org.lwjgl.system.Struct
clear, free, isNull, validate, validateMethods inherited from class org.lwjgl.system.Pointer.Default
address, equals, hashCode, toStringMethods inherited from interface org.lwjgl.system.NativeResource
close, free
-
Field Details
-
SIZEOF
public static final int SIZEOFThe struct size in bytes. -
ALIGNOF
public static final int ALIGNOFThe struct alignment in bytes. -
VERTEX_OFFSET
public static final int VERTEX_OFFSETThe struct member offsets. -
TRIANGLE_OFFSET
public static final int TRIANGLE_OFFSETThe struct member offsets. -
VERTEX_COUNT
public static final int VERTEX_COUNTThe struct member offsets. -
TRIANGLE_COUNT
public static final int TRIANGLE_COUNTThe struct member offsets.
-
-
Constructor Details
-
MeshoptMeshlet
Creates aMeshoptMeshletinstance at the current position of the specifiedByteBuffercontainer. Changes to the buffer's content will be visible to the struct instance and vice versa.The created instance holds a strong reference to the container object.
-
-
Method Details
-
sizeof
public int sizeof()- Specified by:
sizeofin classorg.lwjgl.system.Struct<MeshoptMeshlet>
-
vertex_offset
public int vertex_offset()offset withinmeshlet_verticesarray with meshlet data -
triangle_offset
public int triangle_offset()offset withinmeshlet_trianglesarray with meshlet data -
vertex_count
public int vertex_count()number of vertices used in the meshlet; data is stored in consecutive range defined by offset and count -
triangle_count
public int triangle_count()number of triangles used in the meshlet; data is stored in consecutive range defined by offset and count -
malloc
Returns a newMeshoptMeshletinstance allocated withmemAlloc. The instance must be explicitly freed. -
calloc
Returns a newMeshoptMeshletinstance allocated withmemCalloc. The instance must be explicitly freed. -
create
Returns a newMeshoptMeshletinstance allocated withBufferUtils. -
create
Returns a newMeshoptMeshletinstance for the specified memory address. -
createSafe
-
malloc
Returns a newMeshoptMeshlet.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
Returns a newMeshoptMeshlet.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
Returns a newMeshoptMeshlet.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
Create aMeshoptMeshlet.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
-
malloc
Returns a newMeshoptMeshletinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
Returns a newMeshoptMeshletinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
Returns a newMeshoptMeshlet.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
calloc
Returns a newMeshoptMeshlet.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
capacity- the buffer capacitystack- the stack from which to allocate
-
nvertex_offset
public static int nvertex_offset(long struct) Unsafe version ofvertex_offset(). -
ntriangle_offset
public static int ntriangle_offset(long struct) Unsafe version oftriangle_offset(). -
nvertex_count
public static int nvertex_count(long struct) Unsafe version ofvertex_count(). -
ntriangle_count
public static int ntriangle_count(long struct) Unsafe version oftriangle_count().
-