Added a quick printout of the hardware info. Running into a problem choosing between platforms, going to abstract CL out into it's own class and hide all that logic

This commit is contained in:
MitchellHansen
2016-08-14 00:03:44 -07:00
parent 3c9b39f682
commit edd8075afb
19 changed files with 2159 additions and 2084 deletions

View File

@@ -1,46 +1,46 @@
#pragma once
#include <SFML/System/Vector3.hpp>
#include <SFML/System/Vector2.hpp>
#include <Map.h>
class RayCaster {
public:
RayCaster(Map *map,
sf::Vector3<int> map_dimensions,
sf::Vector2<int> viewport_resolution);
~RayCaster();
void setFOV(float fov);
void setResolution(sf::Vector2<int> resolution);
sf::Color* CastRays(sf::Vector3<float> camera_direction, sf::Vector3<float> camera_position);
void moveCamera(sf::Vector2f v);
private:
sf::Vector3<int> map_dimensions;
Map *map;
// The XY resolution of the viewport
sf::Vector2<int> resolution;
// The pixel array, maybe do RBGA? Are there even 4 byte data types?
sf::Color *image;
// The direction of the camera in POLAR coordinates
sf::Vector3<float> camera_direction;
// Convert the polar coordinates to CARTESIAN
sf::Vector3<float> camera_direction_cartesian;
// The world-space position of the camera
sf::Vector3<float> camera_position;
// The distance in units the view plane is from the iris point
int view_plane_distance = 200;
// Precalculated values for the view plane rays
sf::Vector3f *view_plane_vectors;
};
#pragma once
#include <SFML/System/Vector3.hpp>
#include <SFML/System/Vector2.hpp>
#include <Map.h>
class RayCaster {
public:
RayCaster(Map *map,
sf::Vector3<int> map_dimensions,
sf::Vector2<int> viewport_resolution);
~RayCaster();
void setFOV(float fov);
void setResolution(sf::Vector2<int> resolution);
sf::Color* CastRays(sf::Vector3<float> camera_direction, sf::Vector3<float> camera_position);
void moveCamera(sf::Vector2f v);
private:
sf::Vector3<int> map_dimensions;
Map *map;
// The XY resolution of the viewport
sf::Vector2<int> resolution;
// The pixel array, maybe do RBGA? Are there even 4 byte data types?
sf::Color *image;
// The direction of the camera in POLAR coordinates
sf::Vector3<float> camera_direction;
// Convert the polar coordinates to CARTESIAN
sf::Vector3<float> camera_direction_cartesian;
// The world-space position of the camera
sf::Vector3<float> camera_position;
// The distance in units the view plane is from the iris point
int view_plane_distance = 200;
// Precalculated values for the view plane rays
sf::Vector3f *view_plane_vectors;
};