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:
12
src/Map.cpp
12
src/Map.cpp
@@ -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)
|
||||
};
|
||||
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user