A math package for use with Thyseus - or for general use if you need your math primitives as classes.
This package is essentially a class reimplementation of
gl-matrix
; all credit to
toji and gl-matrix
maintainers.
pnpm add @thyseus/math
-
this
is mutable; arguments are immutable.- Methods never mutate passed arguments, only
this
!
- Methods never mutate passed arguments, only
- No hidden object creation.
- Methods other than
clone()
never create objects.
- Methods other than
- Fully tree-shakeable.
- While some methods assume certain types as arguments, there are no internal dependencies so you only pay for what you use.
Mat4
Quat
Vec2
Vec3
Vec4
clamp(min: number, value: number, max: number): number
degreesToRadians(degrees: number): number
radiansToDegrees(radians: number): number
HALF_PI
PI
TAU
ORIGIN
EPSILON
-
NORTH
/SOUTH
/EAST
/WEST
/UP
/DOWN