cleaned up an unused file, added check for sharing

This commit is contained in:
2016-10-10 23:14:45 -07:00
parent de2f0ad6a1
commit c734614e5f
6 changed files with 104 additions and 210 deletions

View File

@@ -1,9 +1,4 @@
#pragma once
#include "Map.h"
#include <iostream>
#include <SFML/System/Vector3.hpp>
#include <SFML/System/Vector2.hpp>
#include "util.hpp"
Map::Map(sf::Vector3i position) {
@@ -136,24 +131,24 @@ void Map::generate_octree() {
// ////// for (int y = 0; y < dim.y; y++) {
// //// double height = 0;
//
// //// z += -x*2 * std::sin(std::sqrt(abs(x*2 - y*2 - 47))) -
// //// (y*2 + 47) * std::sin(std::sqrt(std::abs(y*2 + 47 + x*2 / 2)));
// //// z += -x*2 * std::sin(std::sqrt(abs(x*2 - y*2 - 47))) -
// //// (y*2 + 47) * std::sin(std::sqrt(std::abs(y*2 + 47 + x*2 / 2)));
// ////
//
// //// //z += x * std::sin(std::sqrt(std::abs(y - x + 1))) *
// //// // std::cos(std::sqrt(std::abs(y + x + 1))) +
// //// // (y + 1) *
// //// // std::cos(std::sqrt(std::abs(y - x + 1))) *
// //// // std::sin(std::sqrt(std::abs(y + x + 1)));
// //// //z += x * std::sin(std::sqrt(std::abs(y - x + 1))) *
// //// // std::cos(std::sqrt(std::abs(y + x + 1))) +
// //// // (y + 1) *
// //// // std::cos(std::sqrt(std::abs(y - x + 1))) *
// //// // std::sin(std::sqrt(std::abs(y + x + 1)));
// ////
// //// // Pathological
// //// //z += 0.5 +
// //// // (std::pow(std::sin(std::sqrt(100 * std::pow(x/20, 2) + std::pow(y/20, 2))), 2) - 0.5) /
// //// //z += 0.5 +
// //// // (std::pow(std::sin(std::sqrt(100 * std::pow(x/20, 2) + std::pow(y/20, 2))), 2) - 0.5) /
// //// // (1 + 0.001 * std::pow(std::pow(x/20, 2) - 2 * x/20 * y/20 + std::pow(y/20, 2), 2));
//
// //// // Ackleys
// //// //z += 20 + M_E -
// //// // (20 / (std::pow(M_E, 0.2) * std::sqrt((std::pow(x / 16.0, 2) + std::pow(y / 16.0, 2) + 1) / 2))) -
// //// //z += 20 + M_E -
// //// // (20 / (std::pow(M_E, 0.2) * std::sqrt((std::pow(x / 16.0, 2) + std::pow(y / 16.0, 2) + 1) / 2))) -
// //// // std::pow(M_E, 0.5 * std::cos(2 * M_PI * x / 16.0) + cos(2 * M_PI * y / 16.0));
//
// //// //
@@ -365,18 +360,6 @@ void Map::setVoxel(sf::Vector3i world_position, int val) {
}
void Map::moveLight(sf::Vector2f in) {
//
// sf::Vector3f light_spherical = CartToSphere(global_light);
//
// light_spherical.y += in.y;
// light_spherical.x += in.x;
//
// global_light = SphereToCart(light_spherical);
//
// return;
}
void Chunk::set(int type) {
for (int i = 0; i < CHUNK_DIM * CHUNK_DIM * CHUNK_DIM; i++) {
voxel_data[i] = 0;