Skip to content

Commit

Permalink
port rotate from gl-matrix for vec2, vec3. fixes #23
Browse files Browse the repository at this point in the history
  • Loading branch information
mreinstein committed Mar 20, 2024
1 parent 4e0a639 commit 4a99254
Show file tree
Hide file tree
Showing 303 changed files with 92,056 additions and 20,928 deletions.
2 changes: 1 addition & 1 deletion dist/2.x/mat3-impl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Mat3 } from './mat3';
import { Mat4 } from './mat4';
import Vec2 from './vec2-impl';
export default Mat3;
export declare type Mat3LikeCtor = new (n: number) => Mat3;
export type Mat3LikeCtor = new (n: number) => Mat3;
/**
* Sets the type this library creates for a Mat3
* @param ctor - the constructor for the type. Either `Float32Array`, `Float64Array`, or `Array`
Expand Down
2 changes: 1 addition & 1 deletion dist/2.x/mat3.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
* When created by the library will create the default type which is `Float32Array`
* but can be set by calling {@link mat3.setDefaultType}.
*/
export declare type Mat3 = number[] | Float32Array | Float64Array;
export type Mat3 = number[] | Float32Array | Float64Array;
2 changes: 1 addition & 1 deletion dist/2.x/mat4-impl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@ import { Mat4 } from './mat4';
import { Quat } from './quat';
import Vec3 from './vec3-impl';
export default Mat4;
export declare type Mat4LikeCtor = new (n: number) => Mat4;
export type Mat4LikeCtor = new (n: number) => Mat4;
/**
* Sets the type this library creates for a Mat4
* @param ctor - the constructor for the type. Either `Float32Array`, `Float64Array`, or `Array`
Expand Down
2 changes: 1 addition & 1 deletion dist/2.x/mat4.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@
* When created by the library will create the default type which is `Float32Array`
* but can be set by calling {@link mat4.setDefaultType}.
*/
export declare type Mat4 = number[] | Float32Array | Float64Array;
export type Mat4 = number[] | Float32Array | Float64Array;
2 changes: 1 addition & 1 deletion dist/2.x/quat-impl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@ import { Quat, create, setDefaultType } from './quat';
import { Mat3 } from './mat3.js';
import { Mat4 } from './mat4.js';
import { Vec3 } from './vec3.js';
export declare type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';
export type RotationOrder = 'xyz' | 'xzy' | 'yxz' | 'yzx' | 'zxy' | 'zyx';
export default Quat;
export { create, setDefaultType };
/**
Expand Down
2 changes: 1 addition & 1 deletion dist/2.x/quat.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* When created by the library will create the default type which is `Float32Array`
* but can be set by calling {@link quat.setDefaultType}.
*/
export declare type Quat = number[] | Float32Array | Float64Array;
export type Quat = number[] | Float32Array | Float64Array;
/**
*
* Quat4 math functions.
Expand Down
9 changes: 9 additions & 0 deletions dist/2.x/vec2-impl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -350,3 +350,12 @@ export declare function transformMat4(v: Vec2, m: Mat4, dst?: Vec2): Vec2;
* @returns the transformed vector
*/
export declare function transformMat3(v: Vec2, m: Mat3, dst?: Vec2): Vec2;
/**
* Rotate a 2D vector
*
* @param a The vec2 point to rotate
* @param b The origin of the rotation
* @param rad The angle of rotation in radians
* @returns the rotated vector
*/
export declare function rotate(a: Vec2, b: Vec2, rad: number, dst?: Vec2): Vec2;
2 changes: 1 addition & 1 deletion dist/2.x/vec2.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* When created by the library will create the default type which is `Float32Array`
* but can be set by calling {@link vec2.setDefaultType}.
*/
export declare type Vec2 = number[] | Float32Array | Float64Array;
export type Vec2 = number[] | Float32Array | Float64Array;
/**
*
* Vec2 math functions.
Expand Down
30 changes: 30 additions & 0 deletions dist/2.x/vec3-impl.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -389,3 +389,33 @@ export declare function getAxis(m: Mat4, axis: number, dst?: Vec3): Vec3;
* @param dst - The vector to set. If not passed a new one is created.
*/
export declare function getScaling(m: Mat4, dst: Vec3): Vec3;
/**
* Rotate a 3D vector around the x-axis
*
* @param {ReadonlyVec3} a The vec3 point to rotate
* @param {ReadonlyVec3} b The origin of the rotation
* @param {Number} rad The angle of rotation in radians
* @param dst - The vector to set. If not passed a new one is created.
* @returns the rotated vector
*/
export declare function rotateX(a: Vec3, b: Vec3, rad: number, dst?: Vec3): Vec3;
/**
* Rotate a 3D vector around the y-axis
*
* @param {ReadonlyVec3} a The vec3 point to rotate
* @param {ReadonlyVec3} b The origin of the rotation
* @param {Number} rad The angle of rotation in radians
* @param dst - The vector to set. If not passed a new one is created.
* @returns the rotated vector
*/
export declare function rotateY(a: Vec3, b: Vec3, rad: number, dst?: Vec3): Vec3;
/**
* Rotate a 3D vector around the z-axis
*
* @param {ReadonlyVec3} a The vec3 point to rotate
* @param {ReadonlyVec3} b The origin of the rotation
* @param {Number} rad The angle of rotation in radians
* @param dst - The vector to set. If not passed a new one is created.
* @returns {vec3} out
*/
export declare function rotateZ(a: Vec3, b: Vec3, rad: number, dst?: Vec3): Vec3;
2 changes: 1 addition & 1 deletion dist/2.x/vec3.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* When created by the library will create the default type which is `Float32Array`
* but can be set by calling {@link vec3.setDefaultType}.
*/
export declare type Vec3 = number[] | Float32Array | Float64Array;
export type Vec3 = number[] | Float32Array | Float64Array;
/**
*
* Vec3 math functions.
Expand Down
2 changes: 1 addition & 1 deletion dist/2.x/vec4.d.ts
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
* When created by the library will create the default type which is `Float32Array`
* but can be set by calling {@link vec4.setDefaultType}.
*/
export declare type Vec4 = number[] | Float32Array | Float64Array;
export type Vec4 = number[] | Float32Array | Float64Array;
/**
*
* Vec4 math functions.
Expand Down
Loading

0 comments on commit 4a99254

Please sign in to comment.