Class AIMaterial

All Implemented Interfaces:
AutoCloseable, NativeResource, Pointer

public class AIMaterial extends Struct<AIMaterial> implements NativeResource
Data structure for a material.

Material data is stored using a key-value structure. A single key-value pair is called a 'material property'. C++ users should use the provided member functions of aiMaterial to process material properties, C users have to stick with the aiMaterialGetXXX family of unbound functions. The library defines a set of standard keys (AI_MATKEY_XXX).

Layout


 struct aiMaterial {
     struct aiMaterialProperty ** mProperties();
     unsigned int mNumProperties();
     unsigned int mNumAllocated();
 }
  • Field Details

    • SIZEOF

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

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

      public static final int MPROPERTIES
      The struct member offsets.
    • MNUMPROPERTIES

      public static final int MNUMPROPERTIES
      The struct member offsets.
    • MNUMALLOCATED

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

    • AIMaterial

      public AIMaterial(ByteBuffer container)
      Creates a AIMaterial 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<AIMaterial>
    • mProperties

      public PointerBuffer mProperties()
      List of all material properties loaded.
    • mNumProperties

      public int mNumProperties()
      Number of properties in the data base
    • mNumAllocated

      public int mNumAllocated()
      Storage allocated
    • mProperties

      public AIMaterial mProperties(PointerBuffer value)
      Sets the address of the specified PointerBuffer to the mProperties() field.
    • mNumAllocated

      public AIMaterial mNumAllocated(int value)
      Sets the specified value to the mNumAllocated() field.
    • set

      public AIMaterial set(PointerBuffer mProperties, int mNumAllocated)
      Initializes this struct with the specified values.
    • set

      public AIMaterial set(AIMaterial src)
      Copies the specified struct data to this struct.
      Parameters:
      src - the source struct
      Returns:
      this struct
    • malloc

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

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

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

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

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

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

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

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

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

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

      @Deprecated public static AIMaterial mallocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static AIMaterial callocStack()
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static AIMaterial mallocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(MemoryStack) instead.
    • callocStack

      @Deprecated public static AIMaterial callocStack(MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(MemoryStack) instead.
    • mallocStack

      @Deprecated public static AIMaterial.Buffer mallocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static AIMaterial.Buffer callocStack(int capacity)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • mallocStack

      @Deprecated public static AIMaterial.Buffer mallocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use malloc(int, MemoryStack) instead.
    • callocStack

      @Deprecated public static AIMaterial.Buffer callocStack(int capacity, MemoryStack stack)
      Deprecated.
      Deprecated for removal in 3.4.0. Use calloc(int, MemoryStack) instead.
    • malloc

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

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

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

      public static AIMaterial.Buffer calloc(int capacity, MemoryStack stack)
      Returns a new AIMaterial.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
    • nmProperties

      public static PointerBuffer nmProperties(long struct)
      Unsafe version of mProperties.
    • nmNumProperties

      public static int nmNumProperties(long struct)
      Unsafe version of mNumProperties().
    • nmNumAllocated

      public static int nmNumAllocated(long struct)
      Unsafe version of mNumAllocated().
    • nmProperties

      public static void nmProperties(long struct, PointerBuffer value)
      Unsafe version of mProperties.
    • nmNumProperties

      public static void nmNumProperties(long struct, int value)
      Sets the specified value to the mNumProperties field of the specified struct.
    • nmNumAllocated

      public static void nmNumAllocated(long struct, int value)
      Unsafe version of mNumAllocated.
    • validate

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