vec2-recycle
Another vanilla vector 2 library with recycling
Similar in scope (and based on) https://github.com/tmpvar/vec2.js. Differences:
- uses a cache to recycle vectors to minimize garbage collection
- uses a number[2] without any prototypes
- is not watchable (unlike the above library--removed for speed purposes)
Simple Example
const v1 = vec2const v2 = vec2 // copies to a new vectorconst v3 = vec2 // v1 is replacedvec2 vec2
API Documentation
https://davidfig.github.io/vec2-recycle/jsdoc/
Installation
yarn add vec2-recycle
or
npm i vec2-recycle
Tests
- Clone repository
- yarn install
- yarn test (for jest test code)
Other Libraries
If you liked pixi-viewport, please try my other open source libraries:
- pixi-scrollbox - pixi.js scrollbox: a masked box that can scroll vertically or horizontally with scrollbars (uses pixi-viewport)
- pixi-ease - pixi.js animation library using easing functions
- intersects - a simple collection of 2d collision/intersects functions. Supports points, circles, lines, axis-aligned boxes, and polygons
license
MIT License
(c) 2020 YOPEY YOPEY LLC by David Figatner