mirror of
https://github.com/gosticks/DefinitelyTyped.git
synced 2026-10-03 22:37:03 +00:00
Merge pull request #29047 from byGui/master
[gl-matrix] Add method vec2#rotate()
This commit is contained in:
@@ -74,6 +74,7 @@ outVec2 = vec2.cross(outVec3, vec2A, vec2B);
|
||||
outVec2 = vec2.lerp(outVec2, vec2A, vec2B, 0.5);
|
||||
outVec2 = vec2.random(outVec2);
|
||||
outVec2 = vec2.random(outVec2, 5.0);
|
||||
outVec2 = vec2.rotate(outVec2, vec2A, vec2B, Math.PI * 0.5);
|
||||
outVec2 = vec2.transformMat2(outVec2, vec2A, mat2A);
|
||||
outVec2 = vec2.transformMat2d(outVec2, vec2A, mat2dA);
|
||||
outVec2 = vec2.transformMat3(outVec2, vec2A, mat3A);
|
||||
|
||||
Vendored
+16
-5
@@ -374,6 +374,17 @@ declare module 'gl-matrix' {
|
||||
*/
|
||||
public static random(out: vec2, scale: number): vec2;
|
||||
|
||||
/**
|
||||
* Rotate a 2D vector
|
||||
*
|
||||
* @param out The receiving vec2
|
||||
* @param a The vec2 point to rotate
|
||||
* @param b The origin of the rotation
|
||||
* @param c The angle of rotation
|
||||
* @returns out
|
||||
*/
|
||||
public static rotate(out: vec2, a: vec2, b: vec2, c: number): vec2;
|
||||
|
||||
/**
|
||||
* Transforms the vec2 with a mat2
|
||||
*
|
||||
@@ -1959,13 +1970,13 @@ 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
|
||||
* @param height height of gl context
|
||||
* @returns out
|
||||
*/
|
||||
public static projection(out: mat3, width: number, height: number): mat3;
|
||||
@@ -2510,9 +2521,9 @@ declare module 'gl-matrix' {
|
||||
public static getTranslation(out: vec3, mat: mat4): vec3;
|
||||
|
||||
/**
|
||||
* Returns the scaling factor component of a transformation matrix.
|
||||
* If a matrix is built with fromRotationTranslationScale with a
|
||||
* normalized Quaternion parameter, the returned vector will be
|
||||
* Returns the scaling factor component of a transformation matrix.
|
||||
* If a matrix is built with fromRotationTranslationScale with a
|
||||
* normalized Quaternion parameter, the returned vector will be
|
||||
* the same as the scaling vector originally supplied.
|
||||
* @param {vec3} out Vector to receive scaling factor component
|
||||
* @param {mat4} mat Matrix to be decomposed (input)
|
||||
|
||||
Reference in New Issue
Block a user