@trinketmage/sword
v0.2.2
Published
Javascript animation hero helpers kit
Downloads
341
Maintainers
Readme
sword.js
Getting started
npm i --save @trinketmage/sword
Mathematics
- lerp: Linear interpolation.
- angleToVector: Calculate a 2d vector on unit circle from an angle in degree.
- vectorToAngle: Calculate an angle in degree from a 2d vector (with optional pivot).
3d
- getScreenPos: Screen position (2d vector) of position (3d vector).
- getFovHeigth: Get height of frustrum (y) at a specific depth (z).
glsl
- stagger: glsl implementation of staggers
#pragma glslify: stagger = require(@trinketmage/sword/src/glsl/stagger)
- backgroundCover: glsl UV calculation for background cover for fullscreen texture
#pragma glslify: backgroundCover = require(@trinketmage/sword/src/glsl/backgroundCover)