Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/mhintz/Vec3Storage
Blazing fast storage for your 3-element vectors
https://github.com/mhintz/Vec3Storage
Last synced: 11 days ago
JSON representation
Blazing fast storage for your 3-element vectors
- Host: GitHub
- URL: https://github.com/mhintz/Vec3Storage
- Owner: mhintz
- Created: 2015-11-04T21:36:37.000Z (about 9 years ago)
- Default Branch: master
- Last Pushed: 2015-11-04T22:14:03.000Z (about 9 years ago)
- Last Synced: 2024-08-09T06:12:47.728Z (3 months ago)
- Language: JavaScript
- Size: 125 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
- awesome-blazingly-fast - Vec3Storage - Blazing fast storage for your 3-element vectors (JavaScript)
README
# Vec3Storage
This is kind of a weird one. I wanted to see if I could implement a memory-managed vector-esque dynamic container on top of Javascript's typed arrays. Complete with a "pointer" to unused memory! And it's implemented as a "template" over an arbitrary `TypedArray`...
It's built to have a weird-looking but fast interface, hence everything is a local variable and you have to provide your own `out` storage when calling `get` or `pop`. (See `gl-matrix` for the inspiration here).
It uses a really basic memory-management system that doubles the available storage size whenever it's about to overflow.
(I hope I haven't made an off-by-one error anywhere!)
TODO: accessor functions for the storage to aid compatibility with WebGL functions.
TODO: append-like function that accepts a TypedArray