Package 

Class Transform3D


  • 
    public class Transform3D
    
                        

    3D transformation utility class that mimics iOS CATransform3D implementation Provides more accurate 3D rotation calculations, especially for Z-axis rotation

    • Method Summary

      Modifier and Type Method Description
      static void applyTransform(Matrix outMatrix, PointF anchor, PointF position, float scaleX, float scaleY, float rotationX, float rotationY, float rotationZ, float preComputedCosX, float preComputedCosY) Applies 3D transformation to the given matrix following Lottie Android's transformation orderThis method reuses the provided matrix to avoid object allocation
      static void apply3DRotations(Matrix matrix, float rotationX, float rotationY, float rotationZ, float preComputedCosX, float preComputedCosY) Apply 3D rotations (X, Y, Z) to the matrixThis method can be used independently for repeater or other scenarios
      static boolean has3DRotation(Float rotationX, Float rotationY, Float rotationZ) Check if there is 3D transformation
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • applyTransform

         static void applyTransform(Matrix outMatrix, PointF anchor, PointF position, float scaleX, float scaleY, float rotationX, float rotationY, float rotationZ, float preComputedCosX, float preComputedCosY)

        Applies 3D transformation to the given matrix following Lottie Android's transformation orderThis method reuses the provided matrix to avoid object allocation

        Parameters:
        outMatrix - Output matrix to receive the transformation
        anchor - Anchor point
        position - Position
        scaleX - X-axis scale
        scaleY - Y-axis scale
        rotationX - X-axis rotation (degrees)
        rotationY - Y-axis rotation (degrees)
        rotationZ - Z-axis rotation (degrees)
        preComputedCosX - Pre-computed cos(rotationX) to avoid redundant calculation
        preComputedCosY - Pre-computed cos(rotationY) to avoid redundant calculation
      • apply3DRotations

         static void apply3DRotations(Matrix matrix, float rotationX, float rotationY, float rotationZ, float preComputedCosX, float preComputedCosY)

        Apply 3D rotations (X, Y, Z) to the matrixThis method can be used independently for repeater or other scenarios

        Parameters:
        matrix - Output matrix to receive the rotation transformation
        rotationX - X-axis rotation in degrees
        rotationY - Y-axis rotation in degrees
        rotationZ - Z-axis rotation in degrees
        preComputedCosX - Pre-computed cos(rotationX) to avoid redundant calculation
        preComputedCosY - Pre-computed cos(rotationY) to avoid redundant calculation