cervus
cervus copied to clipboard
:video_game: tiny WebGL 3d game engine
:bulb: Inspirations: - Types of light [in Unity](https://docs.unity3d.com/Manual/Lighting.html) - [Dynamic lighting](https://gamedevelopment.tutsplus.com/tutorials/lets-build-a-3d-graphics-engine-dynamic-lighting--gamedev-9143) - [Threejs lights](https://threejs.org/docs/#api/lights/Light)
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);
Right now, if we want to support both, `WSAD` & `ZQSD` with: ```js game.camera.get_component(Move).dir_desc['81'] = 'l'; game.camera.get_component(Move).dir_desc['90'] = 'f'; ``` Only the latter will work.
#45 added `Entity.look_at` which currently always assumes that the look-at rotation should align the object's `left` direction with the world`s horizontal plane. This might be helpful: https://stackoverflow.com/questions/8942950/how-do-i-find-the-orthogonal-projection-of-a-point-onto-a-plane
When `perform_ticks` executes `update()` multiple time (when `ticks_qty` is > 1), all `update()` calls will the the input data stored in `game.keys`. Because this code is synchronous, any key events...
I removed `Entity.origin` in #37 because of implementation troubles. I know @michalbe would like to see it back, so let's discuss this here. Previous discussion: #35.
Setting `Entity.rotation` to a quarternion should be enough if we expose `quat.fromEurler` and `quat.setAxisAngle` to the user.