
Added Lighting Changes for Vertex Normal Calculation Added Method to Get a Polygons Vertices as a Vector array Added Methods to Add the Color to a Polygon and Vertex Object Added Normalization to the Polygon normal vector Added Vector Normal Calculation to the Model Class Added Light Calculation method to the Rasterizer Class Added Flag to Rasterizer to stop processing when the screen is minimised Added Flat and Gouraud Drawing Methods to the Resterizer Added Standard and INT triangle drawing Methods Added Function to mimic sgn function from Java Added Length to Vector3D class Added / operator to Vector3D class Added Get(x,y,z,w)Int methods to Vertex class Changed Color Variables on the Vertex/Polygon classes to use r, g and b values rather than COLORREF Changed Camera translation functions to use normal Translation Functions Cleaned up Code Removed Unused code from the Camera Class
41 lines
809 B
C++
41 lines
809 B
C++
#pragma once
|
|
#include "Vertex.h"
|
|
#include "Matrix.h"
|
|
#include "SharedTools.h"
|
|
|
|
using namespace SharedTools;
|
|
|
|
class Camera
|
|
{
|
|
public:
|
|
Camera() : _xRot(0), _yRot(0), _zRot(0) {};
|
|
Camera(float xRot, float yRot, float zRot, const Vertex& pos);
|
|
Camera(const Camera& other);
|
|
|
|
~Camera();
|
|
|
|
Matrix UpdateCameraPosition(const Vertex& newPos);
|
|
Matrix RotateCamera(float xRot, float yRot, float zRot);
|
|
|
|
void SetXRot(const float value);
|
|
float GetXRot() const;
|
|
void SetYRot(const float value);
|
|
float GetYRot() const;
|
|
void SetZRot(const float value);
|
|
float GetZRot() const;
|
|
|
|
Matrix GetCurrentCameraTransformMatrix();
|
|
Vertex GetCameraPosition() const;
|
|
|
|
Camera& operator= (const Camera& rhs);
|
|
|
|
private:
|
|
float _xRot;
|
|
float _yRot;
|
|
float _zRot;
|
|
Vertex _cameraPosition;
|
|
|
|
void Copy(const Camera& other);
|
|
};
|
|
|