Class AIMaterialProperty

All Implemented Interfaces:
Pointer

public class AIMaterialProperty extends Struct<AIMaterialProperty>
Data structure for a single material property.

As a user, you'll probably never need to deal with this data structure. Just use the provided aiGetMaterialXXX() family of functions to query material properties easily. Processing them manually is faster, but it is not the recommended way. It isn't worth the effort.

Material property names follow a simple scheme:


 $<name>
 ?<name>
     A public property, there must be corresponding AI_MATKEY_XXX define
     2nd: Public, but ignored by the aiProcess_RemoveRedundantMaterials
     post-processing step.
 ~<name>
     A temporary property for internal use.

Layout


 struct aiMaterialProperty {
     struct aiString mKey();
     unsigned int mSemantic();
     unsigned int mIndex();
     unsigned int mDataLength();
     aiPropertyTypeInfo mType();
     char * mData();
 }
  • Field Details

    • SIZEOF

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

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

      public static final int MKEY
      The struct member offsets.
    • MSEMANTIC

      public static final int MSEMANTIC
      The struct member offsets.
    • MINDEX

      public static final int MINDEX
      The struct member offsets.
    • MDATALENGTH

      public static final int MDATALENGTH
      The struct member offsets.
    • MTYPE

      public static final int MTYPE
      The struct member offsets.
    • MDATA

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

    • AIMaterialProperty

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

      public AIString mKey()
      Specifies the name of the property (key). Keys are generally case insensitive.
    • mSemantic

      public int mSemantic()
      Textures: Specifies their exact usage semantic. For non-texture properties, this member is always 0 (or, better-said, TextureType_NONE).
    • mIndex

      public int mIndex()
      Textures: Specifies the index of the texture. For non-texture properties, this member is always 0.
    • mDataLength

      public int mDataLength()
      Size of the buffer mData is pointing to, in bytes. This value may not be 0.
    • mType

      public int mType()
      Type information for the property. Defines the data layout inside the data buffer. This is used by the library internally to perform debug checks and to utilize proper type conversions. (It's probably a hacky solution, but it works.)
    • mData

      public ByteBuffer mData()
      Binary buffer to hold the property's value. The size of the buffer is always mDataLength.
    • create

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

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

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

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

      public static AIString nmKey(long struct)
      Unsafe version of mKey().
    • nmSemantic

      public static int nmSemantic(long struct)
      Unsafe version of mSemantic().
    • nmIndex

      public static int nmIndex(long struct)
      Unsafe version of mIndex().
    • nmDataLength

      public static int nmDataLength(long struct)
      Unsafe version of mDataLength().
    • nmType

      public static int nmType(long struct)
      Unsafe version of mType().
    • nmData

      public static ByteBuffer nmData(long struct)
      Unsafe version of mData.