UNPKG

@osbjs/osbjs

Version:

a minimalist osu! storyboarding framework

85 lines (84 loc) 3.17 kB
import { Vector2 } from '.'; export declare class Matrix3 { m11: number; m12: number; m13: number; m21: number; m22: number; m23: number; m31: number; m32: number; m33: number; isIdentity: boolean; translation: Vector2; static readonly Identity: Matrix3; constructor(m11?: number, m12?: number, m13?: number, m21?: number, m22?: number, m23?: number, m31?: number, m32?: number, m33?: number); /** * Calculates the determinant for this matrix. */ determinant(): number; /** * Calculates the determinant for this matrix. */ det(): number; /** * Returns a value that indicates whether this instance and another 3x3 matrix are equal. */ equals(m: Matrix3): boolean; /** * Returns a new Matrix3 and with identical elements to this one. */ clone(): Matrix3; /** * Adds each element in one matrix with its corresponding element in a second matrix. */ static add(m1: Matrix3, m2: Matrix3): Matrix3; /** * Subtracts each element in a second matrix from its corresponding element in a first matrix. */ static sub(m1: Matrix3, m2: Matrix3): Matrix3; /** * Returns the matrix that results from multiplying two matrices together. */ static multiply(m1: Matrix3, m2: Matrix3): Matrix3; /** * Returns the matrix that results from scaling all the elements of a specified matrix by a scalar factor. */ static multiplyScalar(m: Matrix3, s: number): Matrix3; /** * Transposes the rows and columns of a matrix. */ static transpose(m: Matrix3): Matrix3; /** * Inverts the specified matrix. The return value indicates whether the operation succeeded. */ static invert(m: Matrix3, result: Matrix3): boolean; /** * Negates the specified matrix by multiplying all its values by -1. */ static negate(m: Matrix3): Matrix3; /** * Performs a linear interpolation from one matrix to a second matrix based on a value that specifies the weighting of the second matrix. */ static lerp(m1: Matrix3, m2: Matrix3, alpha: number): Matrix3; /** * Creates a translation matrix from the specified 2-dimensional vector. */ static createTranslation(v: Vector2): Matrix3; /** * Creates a rotation matrix using the given rotation in radians and a center point (if specified). */ static createRotation(angle: number, center?: Vector2): Matrix3; /** * Creates a scaling matrix from the specified vector scale and a center point (if specified). */ static createScaleVec(v: Vector2, center?: Vector2): Matrix3; /** * Creates a scaling matrix that scales uniformly with the given scale and a center point (if specified). */ static createScaleScalar(s: number, center?: Vector2): Matrix3; /** * Creates a skew matrix from the specified angles in radians and a center point (if specified). */ static createSkew(angleX: number, angleY: number, center?: Vector2): Matrix3; }