mirror of
https://github.com/zhigang1992/DefinitelyTyped.git
synced 2026-05-16 19:09:18 +08:00
Add missing fromRotationTranslationScale to gl-matrix (#9828)
This commit is contained in:
committed by
Masahiro Wakame
parent
7fe39041b0
commit
84cfb49207
@@ -308,6 +308,11 @@ q = [0, 0, 0, 1];
|
||||
out = mat4.fromRotationTranslation(out, q, [1, 2, 3]);
|
||||
out = mat4.fromQuat(out, q);
|
||||
|
||||
q = [0, 0, 0, 1];
|
||||
out = mat4.fromRotationTranslationScale(out, q, [1, 2, 3], [1, 2, 3]);
|
||||
out = mat4.fromQuat(out, q);
|
||||
|
||||
|
||||
// quat
|
||||
var quatA = [1, 2, 3, 4];
|
||||
var quatB = [5, 6, 7, 8];
|
||||
|
||||
23
gl-matrix/gl-matrix.d.ts
vendored
23
gl-matrix/gl-matrix.d.ts
vendored
@@ -1828,8 +1828,27 @@ declare namespace mat4 {
|
||||
* @param v Translation vector
|
||||
* @returns out
|
||||
*/
|
||||
export function fromRotationTranslation(out: GLM.IArray, q: GLM.IArray,
|
||||
v: GLM.IArray): GLM.IArray;
|
||||
export function fromRotationTranslation(out: GLM.IArray, q: GLM.IArray, v: GLM.IArray): GLM.IArray;
|
||||
|
||||
/**
|
||||
* Creates a matrix from a quaternion rotation, vector translation and vector scale.
|
||||
*
|
||||
* This is equivalent to (but much faster than):
|
||||
*
|
||||
* mat4.identity(dest);
|
||||
* mat4.translate(dest, vec);
|
||||
* var quatMat = mat4.create();
|
||||
* quat4.toMat4(quat, quatMat);
|
||||
* mat4.multiply(dest, quatMat);
|
||||
* mat4.scale(dest, scale)
|
||||
*
|
||||
* @param out mat4 receiving operation result
|
||||
* @param q Rotation quaternion
|
||||
* @param v Translation vector
|
||||
* @param s Scale vector
|
||||
* @returns out
|
||||
*/
|
||||
export function fromRotationTranslationScale(out: GLM.IArray, q: GLM.IArray, v: GLM.IArray, s: GLM.IArray): GLM.IArray
|
||||
|
||||
/**
|
||||
* Creates a matrix from a quaternion
|
||||
|
||||
Reference in New Issue
Block a user