Class ParOctasphereMesh

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class ParOctasphereMesh extends Struct<ParOctasphereMesh> implements NativeResource

 struct par_octasphere_mesh {
     float * positions;
     float * normals;
     float * texcoords;
     uint16_t * indices;
     uint32_t num_indices;
     uint32_t num_vertices;
 }
  • Field Details

    • SIZEOF

      public static final int SIZEOF
      The struct size in bytes.
    • ALIGNOF

      public static final int ALIGNOF
      The struct alignment in bytes.
    • POSITIONS

      public static final int POSITIONS
      The struct member offsets.
    • NORMALS

      public static final int NORMALS
      The struct member offsets.
    • TEXCOORDS

      public static final int TEXCOORDS
      The struct member offsets.
    • INDICES

      public static final int INDICES
      The struct member offsets.
    • NUM_INDICES

      public static final int NUM_INDICES
      The struct member offsets.
    • NUM_VERTICES

      public static final int NUM_VERTICES
      The struct member offsets.
  • Constructor Details

    • ParOctasphereMesh

      public ParOctasphereMesh(ByteBuffer container)
      Creates a ParOctasphereMesh 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 Details

    • sizeof

      public int sizeof()
      Description copied from class: Struct
      Returns sizeof(struct).
      Specified by:
      sizeof in class Struct<ParOctasphereMesh>
    • positions

      public FloatBuffer positions(int capacity)
      Returns:
      a FloatBuffer view of the data pointed to by the positions field.
    • normals

      public @Nullable FloatBuffer normals(int capacity)
      Returns:
      a FloatBuffer view of the data pointed to by the normals field.
    • texcoords

      public @Nullable FloatBuffer texcoords(int capacity)
      Returns:
      a FloatBuffer view of the data pointed to by the texcoords field.
    • indices

      public ShortBuffer indices(int capacity)
      Returns:
      a ShortBuffer view of the data pointed to by the indices field.
    • num_indices

      public int num_indices()
      Returns:
      the value of the num_indices field.
    • num_vertices

      public int num_vertices()
      Returns:
      the value of the num_vertices field.
    • positions

      public ParOctasphereMesh positions(FloatBuffer value)
      Sets the address of the specified FloatBuffer to the positions field.
    • normals

      public ParOctasphereMesh normals(@Nullable FloatBuffer value)
      Sets the address of the specified FloatBuffer to the normals field.
    • texcoords

      public ParOctasphereMesh texcoords(@Nullable FloatBuffer value)
      Sets the address of the specified FloatBuffer to the texcoords field.
    • indices

      public ParOctasphereMesh indices(ShortBuffer value)
      Sets the address of the specified ShortBuffer to the indices field.
    • set

      public ParOctasphereMesh set(FloatBuffer positions, @Nullable FloatBuffer normals, @Nullable FloatBuffer texcoords, ShortBuffer indices)
      Initializes this struct with the specified values.
    • set

      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

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

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

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

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

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

      public static ParOctasphereMesh.Buffer create(int capacity)
      Returns a new ParOctasphereMesh.Buffer instance allocated with BufferUtils.
      Parameters:
      capacity - the buffer capacity
    • create

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

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

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

      public static ParOctasphereMesh calloc(MemoryStack stack)
      Returns a new ParOctasphereMesh instance allocated on the specified MemoryStack and initializes all its bits to zero.
      Parameters:
      stack - the stack from which to allocate
    • malloc

      public static ParOctasphereMesh.Buffer malloc(int capacity, MemoryStack stack)
      Returns a new ParOctasphereMesh.Buffer instance allocated on the specified MemoryStack.
      Parameters:
      capacity - the buffer capacity
      stack - the stack from which to allocate
    • calloc

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

      public static FloatBuffer npositions(long struct, int capacity)
      Unsafe version of positions.
    • nnormals

      public static @Nullable FloatBuffer nnormals(long struct, int capacity)
      Unsafe version of normals.
    • ntexcoords

      public static @Nullable FloatBuffer ntexcoords(long struct, int capacity)
      Unsafe version of texcoords.
    • nindices

      public static ShortBuffer nindices(long struct, int capacity)
      Unsafe version of indices.
    • nnum_indices

      public static int nnum_indices(long struct)
      Unsafe version of num_indices().
    • nnum_vertices

      public static int nnum_vertices(long struct)
      Unsafe version of num_vertices().
    • npositions

      public static void npositions(long struct, FloatBuffer value)
      Unsafe version of positions.
    • nnormals

      public static void nnormals(long struct, @Nullable FloatBuffer value)
      Unsafe version of normals.
    • ntexcoords

      public static void ntexcoords(long struct, @Nullable FloatBuffer value)
      Unsafe version of texcoords.
    • nindices

      public static void nindices(long struct, ShortBuffer value)
      Unsafe version of indices.
    • validate

      public static void validate(long struct)
      Validates pointer members that should not be NULL.
      Parameters:
      struct - the struct to validate