maxogden/voxel-engine — pull request #12 by chrisdickinson (2013-01-21 07:09:53+00:00)
Title: Use `collide-3d-tilemap` for collisions

There'll be a corresponding pull request on `player-physics` since this mucks about with unit sizes there (inadvertantly, I swear).

[here's a demo](http://neversaw.us/voxel/)

some notes:

* we have to translate out of modelspace (from `controls.velocity`) to worldspace to get an accurate vector to feed to `collide-3d-tilemap`. this is ugly.
* we sidestep a lot of `player-physics` because of this -- essentially we have to zero out the vector each step because we don't want `player-physics` to move the viewport.
* the other downside is that it breaks jumping (the up portion of the jump is instantaneous, not smooth). we could fix it making "jump" a polling API instead of an event-based one, maybe.