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 and 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 and Description
      static int SIZEOF
      The struct size in bytes.
      • Fields inherited from interface org.lwjgl.system.Pointer

        POINTER_SHIFT, POINTER_SIZE
    • Constructor Summary

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

      • SIZEOF

        public static final int SIZEOF
        The struct size in bytes.
    • 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.
      • 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.