fenomas / noa

Experimental voxel game engine.
MIT License
616 stars 91 forks source link

Added a pre chunk build event #38

Closed terrac closed 6 years ago

terrac commented 6 years ago

For doing logic to build before the chunks are queued

fenomas commented 6 years ago

Hey, just to check, at this point it's only rebuilding the queue of chunks that are in range of the player - the chunks may not get built until later. Is that the right event you need?

terrac commented 6 years ago

Yeah.

Its for randomly generating things greater than the size of one chunk further out than the visible view distance. So if I have a saved bit of block data that is the size of 3 chunks I can add it before the worldataneeded gets called on any of the visible chunks.

fenomas commented 6 years ago

Ah, I see - so you're taking the coords (which are the chunk coords of the chunk the player has just entered) and testing the distance to the large object, is that right?

I'll go ahead and add an event here, with the name playerEnteredChunk since that's specifically what triggers it happening.

I'll push this to the develop branch shortly. Thanks!