-
public class Transform3D3D 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 voidapplyTransform(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 voidapply3DRotations(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 booleanhas3DRotation(Float rotationX, Float rotationY, Float rotationZ)Check if there is 3D transformation -
-
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 transformationanchor- Anchor pointposition- PositionscaleX- X-axis scalescaleY- Y-axis scalerotationX- X-axis rotation (degrees)rotationY- Y-axis rotation (degrees)rotationZ- Z-axis rotation (degrees)preComputedCosX- Pre-computed cos(rotationX) to avoid redundant calculationpreComputedCosY- 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 transformationrotationX- X-axis rotation in degreesrotationY- Y-axis rotation in degreesrotationZ- Z-axis rotation in degreespreComputedCosX- Pre-computed cos(rotationX) to avoid redundant calculationpreComputedCosY- Pre-computed cos(rotationY) to avoid redundant calculation
-
has3DRotation
static boolean has3DRotation(Float rotationX, Float rotationY, Float rotationZ)
Check if there is 3D transformation
-
-
-
-