Added a definition for projection in mat3 class in gl-Matrix (#20294)

* Added a definition for projection in mat3 class

Added the missing definition for projection function in the `mat3` class

* Added semicolon

Added missing semicolon.

* Added test for mat3.projection()

Added test for mat3.projection()
This commit is contained in:
Kaesebrot84
2017-10-06 19:08:08 +02:00
committed by Ryan Cavanaugh
parent 0887bbe243
commit e33497fb48
2 changed files with 11 additions and 0 deletions

View File

@@ -267,6 +267,7 @@ outMat3 = mat3.multiplyScalar (outMat3, mat3A, 2);
outMat3 = mat3.multiplyScalarAndAdd (outMat3, mat3A, mat3B, 2);
outBool = mat3.exactEquals(mat3A, mat3B);
outBool = mat3.equals(mat3A, mat3B);
outMat3 = mat3.projection(outMat3, 100, 100);
//mat4
outMat4 = mat4.create();

View File

@@ -1950,6 +1950,16 @@ declare module 'gl-matrix' {
* @returns out
*/
public static transpose(out: mat3, a: mat3): mat3;
/**
* Generates a 2D projection matrix with the given bounds
*
* @param out the receiving matrix
* @param width width of your gl context
* @param height height of gl context
* @returns out
*/
public static projection(out: mat3, width: number, height: number): mat3;
/**
* Inverts a mat3