Class 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.NativeResource

    Layout

    
     struct meshopt_Bounds {
         float center()[3];
         float radius;
         float cone_apex()[3];
         float cone_axis[3];
         float cone_cutoff();
         char cone_axis_s8()[3];
         char cone_cutoff_s8;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • CENTER, RADIUS, CONE_APEX, CONE_AXIS, CONE_CUTOFF, CONE_AXIS_S8, CONE_CUTOFF_S8

        The struct member offsets.
    • Constructor Detail

      • MeshoptBounds

        public MeshoptBounds​(java.nio.ByteBuffer container)
        Creates a MeshoptBounds instance at the current position of the specified ByteBuffer container. 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:
        sizeof in class org.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 radius field.
      • 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 FloatBuffer view of the cone_axis field.
      • cone_axis

        public float cone_axis​(int index)
        Returns:
        the value at the specified index of the cone_axis field.
      • 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-bit SNORM format; decode using x/127.0
      • cone_cutoff_s8

        public byte cone_cutoff_s8()
        Returns:
        the value of the cone_cutoff_s8 field.
      • malloc

        public static MeshoptBounds malloc()
        Returns a new MeshoptBounds instance allocated with memAlloc. The instance must be explicitly freed.
      • calloc

        public static MeshoptBounds calloc()
        Returns a new MeshoptBounds instance allocated with memCalloc. The instance must be explicitly freed.
      • create

        public static MeshoptBounds create()
        Returns a new MeshoptBounds instance allocated with BufferUtils.
      • create

        public static MeshoptBounds create​(long address)
        Returns a new MeshoptBounds instance for the specified memory address.
      • createSafe

        @Nullable
        public static MeshoptBounds createSafe​(long address)
        Like create, but returns null if address is NULL.
      • malloc

        public static MeshoptBounds.Buffer malloc​(int capacity)
        Returns a new MeshoptBounds.Buffer instance allocated with memAlloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • calloc

        public static MeshoptBounds.Buffer calloc​(int capacity)
        Returns a new MeshoptBounds.Buffer instance allocated with memCalloc. The instance must be explicitly freed.
        Parameters:
        capacity - the buffer capacity
      • create

        public static MeshoptBounds.Buffer create​(long address,
                                                  int capacity)
        Create a MeshoptBounds.Buffer instance at the specified memory.
        Parameters:
        address - the memory address
        capacity - the buffer capacity
      • createSafe

        @Nullable
        public static MeshoptBounds.Buffer createSafe​(long address,
                                                      int capacity)
        Like create, but returns null if address is NULL.
      • malloc

        public static MeshoptBounds malloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new MeshoptBounds instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • calloc

        public static MeshoptBounds calloc​(org.lwjgl.system.MemoryStack stack)
        Returns a new MeshoptBounds instance allocated on the specified MemoryStack and 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 new MeshoptBounds.Buffer instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • calloc

        public static MeshoptBounds.Buffer calloc​(int capacity,
                                                  org.lwjgl.system.MemoryStack stack)
        Returns a new MeshoptBounds.Buffer instance allocated on the specified MemoryStack and initializes all its bits to zero.
        Parameters:
        stack - the stack from which to allocate
        capacity - the buffer capacity
      • ncenter

        public static java.nio.FloatBuffer ncenter​(long struct)
        Unsafe version of center().
      • ncenter

        public static float ncenter​(long struct,
                                    int index)
        Unsafe version of center.
      • nradius

        public static float nradius​(long struct)
        Unsafe version of radius().
      • ncone_apex

        public static java.nio.FloatBuffer ncone_apex​(long struct)
        Unsafe version of cone_apex().
      • ncone_apex

        public static float ncone_apex​(long struct,
                                       int index)
        Unsafe version of cone_apex.
      • ncone_axis

        public static java.nio.FloatBuffer ncone_axis​(long struct)
        Unsafe version of cone_axis().
      • ncone_axis

        public static float ncone_axis​(long struct,
                                       int index)
        Unsafe version of cone_axis.
      • ncone_cutoff

        public static float ncone_cutoff​(long struct)
        Unsafe version of cone_cutoff().
      • ncone_axis_s8

        public static java.nio.ByteBuffer ncone_axis_s8​(long struct)
        Unsafe version of cone_axis_s8().
      • ncone_axis_s8

        public static byte ncone_axis_s8​(long struct,
                                         int index)
        Unsafe version of cone_axis_s8.
      • ncone_cutoff_s8

        public static byte ncone_cutoff_s8​(long struct)
        Unsafe version of cone_cutoff_s8().