You can not select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
38 lines
862 B
38 lines
862 B
8 years ago
|
#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,
|
||
8 years ago
|
sf::Vector2<int> viewport_resolution);
|
||
8 years ago
|
~RayCaster();
|
||
|
|
||
|
|
||
8 years ago
|
sf::Color* CastRays(sf::Vector3<float> camera_direction, sf::Vector3<float> camera_position);
|
||
8 years ago
|
void moveCamera(sf::Vector2f v);
|
||
8 years ago
|
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?
|
||
8 years ago
|
sf::Color *image;
|
||
8 years ago
|
|
||
|
// 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;
|
||
|
};
|
||
|
|