Class AIMaterialProperty

  • All Implemented Interfaces:
    org.lwjgl.system.Pointer

    public class AIMaterialProperty
    extends org.lwjgl.system.Struct
    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.

    Member documentation

    • mKey – Specifies the name of the property (key). Keys are generally case insensitive.
    • mSemantic – Textures: Specifies their exact usage semantic. For non-texture properties, this member is always 0 (or, better-said, TextureType_NONE).
    • mIndex – Textures: Specifies the index of the texture. For non-texture properties, this member is always 0.
    • mDataLength – Size of the buffer mData is pointing to, in bytes. This value may not be 0.
    • 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 – Binary buffer to hold the property's value. The size of the buffer is always mDataLength.

    Layout

    
     struct aiMaterialProperty {
         struct aiString mKey;
         unsigned int mSemantic;
         unsigned int mIndex;
         unsigned int mDataLength;
         aiPropertyTypeInfo mType;
         char * mData;
     }
    • Nested Class Summary

      Nested Classes 
      Modifier and Type Class Description
      static class  AIMaterialProperty.Buffer
      An array of AIMaterialProperty structs.
      • Nested classes/interfaces inherited from interface org.lwjgl.system.Pointer

        org.lwjgl.system.Pointer.Default
    • Field Summary

      Fields 
      Modifier and Type Field Description
      static int ALIGNOF
      The struct alignment in bytes.
      static int MDATA
      MDATALENGTH
      MINDEX
      MKEY
      MSEMANTIC
      MTYPE
      The struct member offsets.
      static int SIZEOF
      The struct size in bytes.
      • Fields inherited from interface org.lwjgl.system.Pointer

        BITS32, BITS64, CLONG_SHIFT, CLONG_SIZE, POINTER_SHIFT, POINTER_SIZE
    • Constructor Summary

      Constructors 
      Constructor Description
      AIMaterialProperty​(java.nio.ByteBuffer container)
      Creates a AIMaterialProperty instance at the current position of the specified ByteBuffer container.
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • MKEY, MSEMANTIC, MINDEX, MDATALENGTH, MTYPE, MDATA

        The struct member offsets.
    • Constructor Detail

      • AIMaterialProperty

        public AIMaterialProperty​(java.nio.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 Detail

      • sizeof

        public int sizeof()
        Specified by:
        sizeof in class org.lwjgl.system.Struct
      • mSemantic

        public int mSemantic()
        Returns the value of the mSemantic field.
      • mIndex

        public int mIndex()
        Returns the value of the mIndex field.
      • mDataLength

        public int mDataLength()
        Returns the value of the mDataLength field.
      • mType

        public int mType()
        Returns the value of the mType field.
      • mData

        public java.nio.ByteBuffer mData()
        Returns a ByteBuffer view of the data pointed to by the mData field.
      • 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.
      • 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 java.nio.ByteBuffer nmData​(long struct)
        Unsafe version of mData.