A decent amount of progress on voxel traversal. Converted most of it to C code to make the CL version easier

This commit is contained in:
MitchellHansen
2017-03-06 01:01:48 -08:00
parent 04a68c1dec
commit 0a457f50a6
4 changed files with 119 additions and 18 deletions

View File

@@ -86,13 +86,13 @@ uint64_t Map::generate_children(sf::Vector3i pos, int dim) {
// The 8 subvoxel coords starting from the 1th direction, the direction of the origin of the 3d grid
// XY, Z++, XY
std::vector<sf::Vector3i> v = {
sf::Vector3i(pos.x, pos.y, pos.z),
sf::Vector3i(pos.x + dim, pos.y, pos.z),
sf::Vector3i(pos.x, pos.y + dim, pos.z),
sf::Vector3i(pos.x , pos.y , pos.z),
sf::Vector3i(pos.x + dim, pos.y , pos.z),
sf::Vector3i(pos.x , pos.y + dim, pos.z),
sf::Vector3i(pos.x + dim, pos.y + dim, pos.z),
sf::Vector3i(pos.x, pos.y, pos.z + dim),
sf::Vector3i(pos.x + dim, pos.y, pos.z + dim),
sf::Vector3i(pos.x, pos.y + dim, pos.z + dim),
sf::Vector3i(pos.x , pos.y , pos.z + dim),
sf::Vector3i(pos.x + dim, pos.y , pos.z + dim),
sf::Vector3i(pos.x , pos.y + dim, pos.z + dim),
sf::Vector3i(pos.x + dim, pos.y + dim, pos.z + dim)
};

View File

@@ -68,7 +68,11 @@ sf::Texture window_texture;
// Y: 1.57 is straight down
// TODO:
// - Texture axis sign flipping issue
// - Diffuse fog hard cut off
// - Infinite light distance, no inverse square
// - Inconsistent lighting constants. GUI manipulation
int main() {
@@ -92,7 +96,7 @@ int main() {
_map.a.get_voxel(sf::Vector3i(5, 5, 0));
// =============================
return 0;
sf::RenderWindow window(sf::VideoMode(WINDOW_X, WINDOW_Y), "SFML");
window.setMouseCursorVisible(false);