typegpu
Version:
A thin layer between JS and WebGPU/WGSL that improves development experience and allows for faster iteration.
37 lines (36 loc) • 1.86 kB
TypeScript
import type { m4x4f, v3f } from '../data/wgslTypes.ts';
/**
* Translates the given 4-by-4 matrix by the given vector.
* @param {m4x4f} matrix - The matrix to be modified.
* @param {v3f} vector - The vector by which to translate the matrix.
* @returns {m4x4f} The translated matrix.
*/
export declare const translate4: import("../types.ts").DualFn<(matrix: m4x4f, vector: v3f) => m4x4f>;
/**
* Scales the given 4-by-4 matrix in each dimension by an amount given by the corresponding entry in the given vector.
* @param {m4x4f} matrix - The matrix to be modified.
* @param {v3f} vector - A vector of three entries specifying the factor by which to scale in each dimension.
* @returns {m4x4f} The scaled matrix.
*/
export declare const scale4: import("../types.ts").DualFn<(matrix: m4x4f, vector: v3f) => m4x4f>;
/**
* Rotates the given 4-by-4 matrix around the x-axis by the given angle.
* @param {m4x4f} matrix - The matrix to be modified.
* @param {number} angle - The angle by which to rotate (in radians).
* @returns {m4x4f} The rotated matrix.
*/
export declare const rotateX4: import("../types.ts").DualFn<(matrix: m4x4f, angle: number) => m4x4f>;
/**
* Rotates the given 4-by-4 matrix around the y-axis by the given angle.
* @param {m4x4f} matrix - The matrix to be modified.
* @param {number} angle - The angle by which to rotate (in radians).
* @returns {m4x4f} The rotated matrix.
*/
export declare const rotateY4: import("../types.ts").DualFn<(matrix: m4x4f, angle: number) => m4x4f>;
/**
* Rotates the given 4-by-4 matrix around the z-axis by the given angle.
* @param {m4x4f} matrix - The matrix to be modified.
* @param {number} angle - The angle by which to rotate (in radians).
* @returns {m4x4f} The rotated matrix.
*/
export declare const rotateZ4: import("../types.ts").DualFn<(matrix: m4x4f, angle: number) => m4x4f>;