@Override // from IMatrix3 public Matrix3 multAffine (IMatrix3 other) { return multAffine(other, new Matrix3()); }
@Override // from IMatrix3 public Matrix3 invertAffine () { return invertAffine(new Matrix3()); }
/** * Creates a matrix from its components. */ public Matrix3 (float m00, float m10, float m20, float m01, float m11, float m21, float m02, float m12, float m22) { set(m00, m10, m20, m01, m11, m21, m02, m12, m22); }
/** * Sets this to a matrix that first scales, then rotates, then translates. * * @return a reference to this matrix, for chaining. */ public Matrix3 setToTransform (IVector translation, float rotation, float scale) { return setToRotation(rotation).set(m00 * scale, m10 * scale, translation.x(), m01 * scale, m11 * scale, translation.y(), 0f, 0f, 1f); }
@Override // from IMatrix3 public Matrix3 invertAffine (Matrix3 result) throws SingularMatrixException { float m00 = this.m00, m01 = this.m01; float m10 = this.m10, m11 = this.m11; float m20 = this.m20, m21 = this.m21; // compute the determinant, storing the subdeterminants for later use float det = m00*m11 - m10*m01; if (Math.abs(det) == 0f) { // determinant is zero; matrix is not invertible throw new SingularMatrixException(this.toString()); } float rdet = 1f / det; return result.set(+m11 * rdet, -m10 * rdet, +(m10*m21 - m20*m11) * rdet, -m01 * rdet, +m00 * rdet, -(m00*m21 - m20*m01) * rdet, 0f, 0f, 1f); }
@Override // from IMatrix3 public Matrix3 lerpAffine (IMatrix3 other, float t) { return lerpAffine(other, t, new Matrix3()); }
/** * Inverts this matrix in-place. * * @return a reference to this matrix, for chaining. */ public Matrix3 invertLocal () { return invert(this); }
/** * Linearly interpolates between this and the specified other matrix (treating the matrices as * affine), placing the result in this matrix. * * @return a reference to this matrix, for chaining. */ public Matrix3 lerpAffineLocal (IMatrix3 other, float t) { return lerpAffine(other, t, this); }
/** * Inverts this matrix in-place as an affine matrix. * * @return a reference to this matrix, for chaining. */ public Matrix3 invertAffineLocal () { return invertAffine(this); }
/** * Multiplies this matrix in-place by another. * * @return a reference to this matrix, for chaining. */ public Matrix3 multLocal (IMatrix3 other) { return mult(other, this); }
/** * Multiplies this matrix in-place by another, treating the matricees as affine. * * @return a reference to this matrix, for chaining. */ public Matrix3 multAffineLocal (IMatrix3 other) { return multAffine(other, this); }
/** * Adds {@code other} to this matrix, in place. * * @return a reference to this matrix, for chaining. */ public Matrix3 addLocal (IMatrix3 other) { return add(other, this); }
/** * Linearly interpolates between the this and the specified other matrix, placing the result in * this matrix. * * @return a reference to this matrix, for chaining. */ public Matrix3 lerpLocal (IMatrix3 other, float t) { return lerp(other, t, this); }
@Override // from IMatrix3 public Vector extractScale () { return extractScale(new Vector()); }
/** * Copy constructor. */ public Matrix3 (Matrix3 other) { set(other); }