@plurid/plurid-engine
Version:
Plurid Engine and Utility Functions
69 lines (68 loc) • 2.73 kB
TypeScript
/**
* Converts the CSS string matrix3d into an array of numbers.
*
* @param matrix3d CSS string obtained from
* window
* .getComputedStyle(element)
* .getPropertyValue('transform').
* @returns Numbers array.
*/
export declare function getMatrixValues(matrix3d: string): number[];
/**
* Extracts the rotation matrix from the matrix3d CSS string.
*
* @param matrix3d CSS string obtained from
* window
* .getComputedStyle(element)
* .getPropertyValue("transform").
* @returns Rotation matrix.
*/
export declare function getRotationMatrix(matrix3d: string): number[];
/**
* Extracts the translation matrix from the matrix3d CSS string.
*
* @param matrix3d CSS string obtained from
* window
* .getComputedStyle(element)
* .getPropertyValue("transform").
* @returns Translation matrix.
*/
export declare function getTranslationMatrix(matrix3d: string): number[];
/**
* Extracts the scalation value from the matrix3d CSS string.
*
* @param matrix3d CSS string obtained from
* window
* .getComputedStyle(element)
* .getPropertyValue("transform").
* @returns Scalation value.
*/
export declare function getScalationValue(matrix3d: string): number;
/**
* Returns a a matrix3d CSS string.
*
* @param rotationMatrix
* @param translationMatrix
* @param scalationMatrix
* @returns matrix3d CSS string.
*/
export declare function setTransform(rotationMatrix: number[], translationMatrix: number[], scalationMatrix: number[]): string;
export interface RotationValues {
rotateX: number;
rotateY: number;
rotateZ: number;
}
export declare function getTransformRotate(matrix3d: string): RotationValues;
export interface TranslationValues {
translateX: number;
translateY: number;
translateZ: number;
}
export declare function getTransformTranslate(matrix3d: string): TranslationValues;
export interface ScalationValue {
scale: number;
}
export declare function getTransformScale(matrix3d: string): ScalationValue;
export declare function rotatePlurid(matrix3d: string, direction?: string, angleIncrement?: number): string;
export declare function translatePlurid(matrix3d: string, direction?: string, linearIncrement?: number): string;
export declare function scalePlurid(matrix3d: string, direction?: string, scaleIncrement?: number): string;