Turned off experimental phong lighting in the kernel
fixed all compiler errors thrown by MSVC Switched experimental octree map back to the old map Refactored old map system, prettied it up
This commit is contained in:
@@ -31,8 +31,8 @@ public:
|
||||
|
||||
private:
|
||||
|
||||
float friction_coefficient = 0.1;
|
||||
float default_impulse = 1.0;
|
||||
float friction_coefficient = 0.1f;
|
||||
float default_impulse = 1.0f;
|
||||
|
||||
// 3D vector
|
||||
sf::Vector3f movement;
|
||||
|
||||
42
include/Old_map.h
Normal file
42
include/Old_map.h
Normal file
@@ -0,0 +1,42 @@
|
||||
#pragma once
|
||||
#include <SFML/System/Vector3.hpp>
|
||||
#include <SFML/System/Vector2.hpp>
|
||||
#include <SFML/Graphics/Color.hpp>
|
||||
#include <random>
|
||||
#include <iostream>
|
||||
#include <functional>
|
||||
#include <cmath>
|
||||
|
||||
#define _USE_MATH_DEFINES
|
||||
#include <math.h>
|
||||
|
||||
#include <deque>
|
||||
|
||||
class Old_Map {
|
||||
public:
|
||||
|
||||
Old_Map(sf::Vector3i dim);
|
||||
~Old_Map();
|
||||
|
||||
void generate_terrain();
|
||||
|
||||
sf::Vector3i getDimensions();
|
||||
char* get_voxel_data();
|
||||
|
||||
protected:
|
||||
|
||||
private:
|
||||
|
||||
double* height_map;
|
||||
char *voxel_data;
|
||||
sf::Vector3i dimensions;
|
||||
|
||||
void set_voxel(sf::Vector3i position, int val);
|
||||
double sample(int x, int y);
|
||||
void set_sample(int x, int y, double value);
|
||||
void sample_square(int x, int y, int size, double value);
|
||||
void sample_diamond(int x, int y, int size, double value);
|
||||
void diamond_square(int stepsize, double scale);
|
||||
|
||||
|
||||
};
|
||||
@@ -36,7 +36,7 @@ public:
|
||||
private:
|
||||
|
||||
CL_Wrapper *cl;
|
||||
bool sharing_supported = False;
|
||||
bool sharing_supported = false;
|
||||
sf::Uint8 *drawing_surface;
|
||||
sf::RenderWindow* window;
|
||||
|
||||
|
||||
@@ -64,7 +64,7 @@ public:
|
||||
else {
|
||||
t.setFont(f);
|
||||
t.setCharacterSize(20);
|
||||
t.setPosition(20, slot * pixel_spacing);
|
||||
t.setPosition(static_cast<float>(20), static_cast<float>(slot * pixel_spacing));
|
||||
}
|
||||
|
||||
}
|
||||
@@ -140,11 +140,11 @@ inline float AngleBetweenVectors(sf::Vector3f a, sf::Vector3f b){
|
||||
}
|
||||
|
||||
inline float DegreesToRadians(float in) {
|
||||
return in * PI / 180.0f;
|
||||
return static_cast<float>(in * PI / 180.0f);
|
||||
}
|
||||
|
||||
inline float RadiansToDegrees(float in) {
|
||||
return in * 180.0f / PI;
|
||||
return static_cast<float>(in * 180.0f / PI);
|
||||
}
|
||||
|
||||
inline std::string read_file(std::string file_name){
|
||||
|
||||
Reference in New Issue
Block a user