0.1.2 • Published 2 years ago

@trinketmage/sword v0.1.2

Weekly downloads
2
License
GPLv3
Repository
github
Last release
2 years ago

sword.js

It's dangerous to go alone! Take this.

Getting started

npm i --save @trinketmage/sword

Core

  • Clock: Object to handle a single render loop with RequestAnimationFrame and keep track of time.

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).

Gesture

  • VirtualScroll: Custom scroll handle for inertia.

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)
0.1.0

2 years ago

0.1.2

2 years ago

0.1.1

2 years ago

0.0.10

4 years ago

0.0.11

4 years ago

0.0.9

5 years ago

0.0.8

5 years ago

0.0.7

5 years ago

0.0.6

5 years ago

0.0.5

5 years ago

0.0.4

5 years ago

0.0.3

5 years ago

0.0.2

5 years ago

0.0.1

5 years ago