Package org.lwjgl.util.meshoptimizer
Class MeshoptBounds
- java.lang.Object
-
- org.lwjgl.system.Pointer.Default
-
- org.lwjgl.system.Struct
-
- org.lwjgl.util.meshoptimizer.MeshoptBounds
-
- All Implemented Interfaces:
java.lang.AutoCloseable,org.lwjgl.system.NativeResource,org.lwjgl.system.Pointer
public class MeshoptBounds extends org.lwjgl.system.Struct implements org.lwjgl.system.NativeResourceLayout
struct meshopt_Bounds { floatcenter()[3]; float radius; floatcone_apex()[3]; float cone_axis[3]; floatcone_cutoff(); charcone_axis_s8()[3]; char cone_cutoff_s8; }
-
-
Nested Class Summary
Nested Classes Modifier and Type Class Description static classMeshoptBounds.BufferAn array ofMeshoptBoundsstructs.
-
Field Summary
Fields Modifier and Type Field Description static intALIGNOFThe struct alignment in bytes.static intCENTER
CONE_APEX
CONE_AXIS
CONE_AXIS_S8
CONE_CUTOFF
CONE_CUTOFF_S8
RADIUSThe struct member offsets.static intSIZEOFThe struct size in bytes.
-
Constructor Summary
Constructors Constructor Description MeshoptBounds(java.nio.ByteBuffer container)Creates aMeshoptBoundsinstance at the current position of the specifiedByteBuffercontainer.
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static MeshoptBoundscalloc()Returns a newMeshoptBoundsinstance allocated withmemCalloc.static MeshoptBounds.Buffercalloc(int capacity)Returns a newMeshoptBounds.Bufferinstance allocated withmemCalloc.static MeshoptBounds.Buffercalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newMeshoptBounds.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.static MeshoptBoundscalloc(org.lwjgl.system.MemoryStack stack)Returns a newMeshoptBoundsinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.java.nio.FloatBuffercenter()bounding sphere, useful for frustum and occlusion cullingfloatcenter(int index)bounding sphere, useful for frustum and occlusion cullingjava.nio.FloatBuffercone_apex()normal cone, useful for backface cullingfloatcone_apex(int index)normal cone, useful for backface cullingjava.nio.FloatBuffercone_axis()floatcone_axis(int index)java.nio.ByteBuffercone_axis_s8()normal cone axis and cutoff, stored in 8-bitSNORMformat; decode usingx/127.0bytecone_axis_s8(int index)normal cone axis and cutoff, stored in 8-bitSNORMformat; decode usingx/127.0floatcone_cutoff()cos(angle/2)bytecone_cutoff_s8()static MeshoptBoundscreate()Returns a newMeshoptBoundsinstance allocated withBufferUtils.static MeshoptBounds.Buffercreate(int capacity)Returns a newMeshoptBounds.Bufferinstance allocated withBufferUtils.static MeshoptBoundscreate(long address)Returns a newMeshoptBoundsinstance for the specified memory address.static MeshoptBounds.Buffercreate(long address, int capacity)Create aMeshoptBounds.Bufferinstance at the specified memory.static MeshoptBoundscreateSafe(long address)static MeshoptBounds.BuffercreateSafe(long address, int capacity)static MeshoptBoundsmalloc()Returns a newMeshoptBoundsinstance allocated withmemAlloc.static MeshoptBounds.Buffermalloc(int capacity)Returns a newMeshoptBounds.Bufferinstance allocated withmemAlloc.static MeshoptBounds.Buffermalloc(int capacity, org.lwjgl.system.MemoryStack stack)Returns a newMeshoptBounds.Bufferinstance allocated on the specifiedMemoryStack.static MeshoptBoundsmalloc(org.lwjgl.system.MemoryStack stack)Returns a newMeshoptBoundsinstance allocated on the specifiedMemoryStack.static java.nio.FloatBufferncenter(long struct)Unsafe version ofcenter().static floatncenter(long struct, int index)Unsafe version ofcenter.static java.nio.FloatBufferncone_apex(long struct)Unsafe version ofcone_apex().static floatncone_apex(long struct, int index)Unsafe version ofcone_apex.static java.nio.FloatBufferncone_axis(long struct)Unsafe version ofcone_axis().static floatncone_axis(long struct, int index)Unsafe version ofcone_axis.static java.nio.ByteBufferncone_axis_s8(long struct)Unsafe version ofcone_axis_s8().static bytencone_axis_s8(long struct, int index)Unsafe version ofcone_axis_s8.static floatncone_cutoff(long struct)Unsafe version ofcone_cutoff().static bytencone_cutoff_s8(long struct)Unsafe version ofcone_cutoff_s8().static floatnradius(long struct)Unsafe version ofradius().floatradius()intsizeof()
-
-
-
Constructor Detail
-
MeshoptBounds
public MeshoptBounds(java.nio.ByteBuffer container)
Creates aMeshoptBoundsinstance 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 Detail
-
sizeof
public int sizeof()
- Specified by:
sizeofin classorg.lwjgl.system.Struct
-
center
public java.nio.FloatBuffer center() public float center(int index)
bounding sphere, useful for frustum and occlusion culling
-
radius
public float radius()
- Returns:
- the value of the
radiusfield.
-
cone_apex
public java.nio.FloatBuffer cone_apex() public float cone_apex(int index)
normal cone, useful for backface culling
-
cone_axis
public java.nio.FloatBuffer cone_axis()
- Returns:
- a
FloatBufferview of thecone_axisfield.
-
cone_axis
public float cone_axis(int index)
- Returns:
- the value at the specified index of the
cone_axisfield.
-
cone_cutoff
public float cone_cutoff()
cos(angle/2)
-
cone_axis_s8
public java.nio.ByteBuffer cone_axis_s8() public byte cone_axis_s8(int index)
normal cone axis and cutoff, stored in 8-bitSNORMformat; decode usingx/127.0
-
cone_cutoff_s8
public byte cone_cutoff_s8()
- Returns:
- the value of the
cone_cutoff_s8field.
-
malloc
public static MeshoptBounds malloc()
Returns a newMeshoptBoundsinstance allocated withmemAlloc. The instance must be explicitly freed.
-
calloc
public static MeshoptBounds calloc()
Returns a newMeshoptBoundsinstance allocated withmemCalloc. The instance must be explicitly freed.
-
create
public static MeshoptBounds create()
Returns a newMeshoptBoundsinstance allocated withBufferUtils.
-
create
public static MeshoptBounds create(long address)
Returns a newMeshoptBoundsinstance for the specified memory address.
-
createSafe
@Nullable public static MeshoptBounds createSafe(long address)
-
malloc
public static MeshoptBounds.Buffer malloc(int capacity)
Returns a newMeshoptBounds.Bufferinstance allocated withmemAlloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
calloc
public static MeshoptBounds.Buffer calloc(int capacity)
Returns a newMeshoptBounds.Bufferinstance allocated withmemCalloc. The instance must be explicitly freed.- Parameters:
capacity- the buffer capacity
-
create
public static MeshoptBounds.Buffer create(int capacity)
Returns a newMeshoptBounds.Bufferinstance allocated withBufferUtils.- Parameters:
capacity- the buffer capacity
-
create
public static MeshoptBounds.Buffer create(long address, int capacity)
Create aMeshoptBounds.Bufferinstance at the specified memory.- Parameters:
address- the memory addresscapacity- the buffer capacity
-
createSafe
@Nullable public static MeshoptBounds.Buffer createSafe(long address, int capacity)
-
malloc
public static MeshoptBounds malloc(org.lwjgl.system.MemoryStack stack)
Returns a newMeshoptBoundsinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocate
-
calloc
public static MeshoptBounds calloc(org.lwjgl.system.MemoryStack stack)
Returns a newMeshoptBoundsinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocate
-
malloc
public static MeshoptBounds.Buffer malloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newMeshoptBounds.Bufferinstance allocated on the specifiedMemoryStack.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
calloc
public static MeshoptBounds.Buffer calloc(int capacity, org.lwjgl.system.MemoryStack stack)
Returns a newMeshoptBounds.Bufferinstance allocated on the specifiedMemoryStackand initializes all its bits to zero.- Parameters:
stack- the stack from which to allocatecapacity- the buffer capacity
-
ncenter
public static java.nio.FloatBuffer ncenter(long struct)
Unsafe version ofcenter().
-
ncenter
public static float ncenter(long struct, int index)Unsafe version ofcenter.
-
nradius
public static float nradius(long struct)
Unsafe version ofradius().
-
ncone_apex
public static java.nio.FloatBuffer ncone_apex(long struct)
Unsafe version ofcone_apex().
-
ncone_apex
public static float ncone_apex(long struct, int index)Unsafe version ofcone_apex.
-
ncone_axis
public static java.nio.FloatBuffer ncone_axis(long struct)
Unsafe version ofcone_axis().
-
ncone_axis
public static float ncone_axis(long struct, int index)Unsafe version ofcone_axis.
-
ncone_cutoff
public static float ncone_cutoff(long struct)
Unsafe version ofcone_cutoff().
-
ncone_axis_s8
public static java.nio.ByteBuffer ncone_axis_s8(long struct)
Unsafe version ofcone_axis_s8().
-
ncone_axis_s8
public static byte ncone_axis_s8(long struct, int index)Unsafe version ofcone_axis_s8.
-
ncone_cutoff_s8
public static byte ncone_cutoff_s8(long struct)
Unsafe version ofcone_cutoff_s8().
-
-