Files
Graphics-Rasterizer/Vertex.h
IDunnoDev 773507b4ab Week7 [09/11] - [11/11]
Added Backface Culling Methods to the Model Class
Added Depth, Normal and Culled Flag Variables to the Polygon3D Class
Added Vector3D Class
Added - operator to the Vertex Class
Cleaned up Code, Adding Void to Params etc
2021-12-11 14:48:46 +00:00

41 lines
718 B
C++

#pragma once
#include "Vector3D.h"
class Vertex
{
public:
Vertex();
Vertex(float x, float y, float z);
Vertex(float x, float y, float z, float w);
Vertex(const Vertex& other);
// Accessors
float GetX() const;
void SetX(const float x);
float GetY() const;
void SetY(const float y);
float GetZ() const;
void SetZ(const float z);
float GetW() const;
void SetW(const float w);
void Dehomogenize();
// Assignment operator
Vertex& operator= (const Vertex& rhs);
bool operator== (const Vertex& rhs) const;
const Vertex operator+ (const Vertex& rhs) const;
const Vector3D operator- (const Vertex& rhs) const;
private:
float _x;
float _y;
float _z;
float _w;
void Copy(const Vertex& other);
};