maxogden/voxel-highlight — pull request #1 by theoxylo (2013-02-22 08:29:31+00:00)
Title: reduced frequency of events and new objects

Hey, I noticed that events were firing 20 times a second so I started poking around. Then I got a little carried away...

I hope it is not too drastic, but I ended up making the following changes:

1. 'remove' event only fired if block is no longer highlighted
2. 'highlight' event only fired if new block is highlighted (or same block is re-highlighted)
3. for both events, the block's voxel index is passed to the callback for reference
4. THREE geometry, material, and mesh objects are only created once (in constructor)
5. Updated camera interrogation to work for both voxel-engine 0.3.6 and 0.5.8
6. Ready for integration into current voxel-hello-world demo project

Thanks for considering it!