Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ability to paint by coordinate (setBlock) #18

Open
shama opened this issue Jun 11, 2013 · 2 comments
Open

Ability to paint by coordinate (setBlock) #18

shama opened this issue Jun 11, 2013 · 2 comments

Comments

@shama
Copy link
Owner

shama commented Jun 11, 2013

That way we don't need to re-mesh when changing a block types > 0.

/cc @vladikoff @vogonistic

@vladikoff
Copy link

https://github.com/shama/voxel-texture/blob/master/index.js#L219 already checks for a hex, where does it re-mesh?

@shama
Copy link
Owner Author

shama commented Jun 11, 2013

In engine, game.setBlock will queue the chunk into game.chunksNeedsUpdate. Then game.updateDirtyChunks will loop through those and call game.showChunk: https://github.com/maxogden/voxel-engine/blob/master/index.js#L528 That will then call voxel-mesh to re-mesh the chunk.

If we had a paint by coordinate here, we could just detect if the block is just changing types and paint the new UV coordinates onto the face and have voxel-engine skip all that unless the block is being removed/added.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants