michalbe / cervus

:video_game: tiny WebGL 3d game engine
MIT License
28 stars 4 forks source link

Reimplement some of the gl-matrix methods #36

Open stasm opened 7 years ago

stasm commented 7 years ago

For instance, mat4.create could be implemented as:

return Float32Array.of(1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1, 0, 0, 0, 0, 1);
stasm commented 7 years ago

There are also quite a few bytes that we could shave off by making our own methods return results instead of writing to the first argument. Once the core code stabilizes I'll make an inventory of the methods we use and I'll try to reimplement them.

michalbe commented 7 years ago

@stasm is this still a valid issue? We've tried that last week, without any reasonable lean boost.

stasm commented 7 years ago

Rolling a custom implementation of matrix math is a big task. gl-matrix does the job well and has a better testing coverage. I vote close.