Linux build working again, removed the GL_Testing stuff, I'm going to move to Vulkan eventually. Got voxel search working mostly with the new octree changes. Issue with mirroring of voxel data currently

This commit is contained in:
2017-07-02 12:36:25 -07:00
parent 04842dd597
commit 5e9401cd27
11 changed files with 72 additions and 303 deletions

View File

@@ -3,6 +3,7 @@
#include <SFML/System/Vector2.hpp>
#include "util.hpp"
#include "Pub_Sub.h"
#include <cmath>
class Camera : public VrEventSubscriber{
public:

View File

@@ -1,43 +0,0 @@
#pragma once
#include <string>
#include <util.hpp>
#include <cstring>
#ifdef _WIN32
#define GLEW_STATIC
#include <GL/glew.h>
#elif defined TARGET_OS_MAC
#include <OpenGL/gl.h>
#endif
class GL_Testing
{
public:
GL_Testing();
~GL_Testing(){};
enum Shader_Type {VERTEX, FRAGMENT};
void compile_shader(std::string file_path, Shader_Type t);
void create_program();
void create_buffers();
void transform();
void rotate(double delta);
void draw();
private:
GLuint VBO; //raw points
GLuint EBO; //link triangles
GLuint VAO;
GLuint vertex_shader;
GLuint fragment_shader;
GLuint shader_program;
GLfloat *matrix;
double counter = 0;
};

View File

@@ -25,11 +25,10 @@ public:
Map(uint32_t dimensions);
void setVoxel(sf::Vector3i position, int val);
bool getVoxelFromOctree(sf::Vector3i position);
bool getVoxel(sf::Vector3i pos);
Octree octree;
Octree octree;
bool test();
@@ -40,8 +39,6 @@ private:
std::stringstream output_stream;
// =========================
void generate_octree(unsigned int dimensions);
char* voxel_data;
};

View File

@@ -24,7 +24,6 @@ public:
static const int buffer_size = 100000;
Octree();
~Octree() {};
@@ -56,10 +55,12 @@ public:
// With a position and the head of the stack. Traverse down the voxel hierarchy to find
// the IDX and stack position of the highest resolution (maybe set resolution?) oct
bool get_voxel(sf::Vector3i position);
bool GetVoxel(sf::Vector3i position);
void print_block(int block_pos);
bool Validate(char* data, sf::Vector3i dimensions);
private:
std::tuple<uint64_t, uint64_t> GenerationRecursion(

View File

@@ -85,7 +85,7 @@ struct device_info {
cl_uint cl_device_preferred_vector_width_double;
char cl_device_profile[256];
size_t cl_device_profiling_timer_resolution;
cl_device_type cl_device_type;
cl_device_type device_type;
char cl_device_vendor[128];
cl_uint cl_device_vendor_id;
char cl_device_version[128];

View File

@@ -7,7 +7,7 @@
#include <sstream>
#include <string>
#include <imgui/imgui.h>
#include <cmath>
const double PI = 3.141592653589793238463;
const float PI_F = 3.14159265358979f;
@@ -268,4 +268,4 @@ inline bool IsLeaf(const uint64_t descriptor) {
}
return false;
}
}