Closed Trenki closed 3 years ago
Whoops, overlooked that. Can you check the version I just pushed and let me know if it works? invalidateChunks
is a feature that I don't personally use so it's not easy for me to test it rigorously.
I used it and found it useless.
I found this method in issues, but I don't know the specific usage.Do you have any good suggestions if I want to load .vox
files asynchronously from the network?
thanks :)
Hmm, this function seems to have been broken even before I changed it the other day. I've pushed another fix, which for me locally appears to work.
Here's a description of how it's supposed to work. In a single player game with no server, worldgen looks like this:
worldDataNeeded
noa.world.setChunkData
Then later if the game client decides that voxel data has changed, it just calls noa.setBlock
for that voxel.
However if you have a server providing world data, you'll probably have cases where the server sends you updated data, and you want noa
to refresh a whole chunk, rather than updating things voxel by voxel. In that case you can call noa.world.invalidateVoxelsInAABB
for the affected area, and noa
will mark those chunks to be de-meshed and disposed. After that's done, if they're within range of the player the engine will issue new worldDataNeeded
events, and the client can supply the fresh data.
Hope that makes sense!
Thank you very much for your help. Using Noa. setBlock
achieved the effect I wanted.
By the way, I found that in the API document, noa.setBlock
has only x,y, and z parameters, not id. I don't know if it's a document error.
Thanks again!
Cheers! I will push a fix on the docs.
when trying to using the
noa.world.invalidateVoxelsInAABB(box)
I get that error.