Moved the view plane calc to the constructor, cleaned up old code. Added / removed relevant comments

This commit is contained in:
2016-08-02 22:40:55 -07:00
parent 1de9c6dd35
commit 2b7dceee1b
5 changed files with 39 additions and 82 deletions

View File

@@ -7,7 +7,7 @@ class Ray {
private:
// The Tail of the vector
// The Tail of the vector
sf::Vector3<float> origin;
// Direction / Length of the vector

View File

@@ -10,6 +10,8 @@ public:
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);
@@ -33,5 +35,12 @@ private:
// 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 = 300;
// Precalculated values for the view plane rays
sf::Vector3f *view_plane_vectors;
};