It's dangerous to go alone! Take this.
npm i --save @trinketmage/sword
- Clock: Object to handle a single render loop with RequestAnimationFrame and keep track of time.
- 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).
- VirtualScroll: Custom scroll handle for inertia.
- getScreenPos: Screen position (2d vector) of position (3d vector).
- getFovHeigth: Get height of frustrum (y) at a specific depth (z).
- 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)