Closed OperationDarkside closed 4 years ago
I think for this to be useful, we need some things explained from you:
Thanks for the initiative!
Thanks for the suggestion, however rolled my own:
//Create a "ray"
Ray ray(mp_player->position, mp_player->rotation);
//Step the ray until it hits a block/ reaches maximum length
for (; ray.getLength() < 8; ray.step()) {
auto rayBlockPosition = toBlockPosition(ray.getEndpoint());
if (m_chunks.manager.getBlock(rayBlockPosition) == 1) {
BlockUpdate blockUpdate;
blockUpdate.block = button == sf::Mouse::Left ? 0 : 1;
blockUpdate.position = button == sf::Mouse::Left
? rayBlockPosition
: toBlockPosition(ray.getLastPoint());
m_chunks.blockUpdates.push_back(blockUpdate);
}
}
Thanks for contributing to the project anyways :)
Hi,
I recently started a similar project and wrote a different algorithm for finding removal/placing blocks than you in your one-week challenge. If you want you can take this code: