Class AIUVTransform

  • All Implemented Interfaces:
    java.lang.AutoCloseable, NativeResource, Pointer

    public class AIUVTransform
    extends Struct
    implements NativeResource
    Defines how an UV channel is transformed.

    This is just a helper structure for the Assimp._AI_MATKEY_UVTRANSFORM_BASE key. See its documentation for more details.

    Typically you'll want to build a matrix of this information. However, we keep separate scaling/translation/rotation values to make it easier to process and optimize UV transformations internally.

    Member documentation

    • mTranslation – Translation on the u and v axes. The default value is (0|0).
    • mScaling – Scaling on the u and v axes. The default value is (1|1).
    • mRotation – Rotation - in counter-clockwise direction. The rotation angle is specified in radians. The rotation center is 0.5f|0.5f. The default value 0.f.

    Layout

    
     struct aiUVTransform {
         struct aiVector2D mTranslation;
         struct aiVector2D mScaling;
         float mRotation;
     }
    • Field Detail

      • SIZEOF

        The struct size in bytes.
      • ALIGNOF

        The struct alignment in bytes.
      • MTRANSLATION, MSCALING, MROTATION

        The struct member offsets.
    • Constructor Detail

      • AIUVTransform

        public AIUVTransform​(java.nio.ByteBuffer container)
        Creates a AIUVTransform 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()
        Description copied from class: Struct
        Returns sizeof(struct).
        Specified by:
        sizeof in class Struct
      • mTranslation

        public AIVector2D mTranslation()
        Returns a AIVector2D view of the mTranslation field.
      • mRotation

        public float mRotation()
        Returns the value of the mRotation field.
      • malloc

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

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

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

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

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

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

        public static AIUVTransform mallocStack()
        Returns a new AIUVTransform instance allocated on the thread-local MemoryStack.
      • callocStack

        public static AIUVTransform callocStack()
        Returns a new AIUVTransform instance allocated on the thread-local MemoryStack and initializes all its bits to zero.
      • mallocStack

        public static AIUVTransform mallocStack​(MemoryStack stack)
        Returns a new AIUVTransform instance allocated on the specified MemoryStack.
        Parameters:
        stack - the stack from which to allocate
      • callocStack

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

        public static float nmRotation​(long struct)
        Unsafe version of mRotation().