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
This commit is contained in:
29
Model.h
29
Model.h
@ -1,8 +1,11 @@
|
||||
#pragma once
|
||||
#include "Polygon3D.h"
|
||||
#include "Vector3D.h"
|
||||
#include "Vertex.h"
|
||||
#include "Polygon3D.h"
|
||||
#include "Matrix.h"
|
||||
#include "Camera.h"
|
||||
#include <vector>
|
||||
#include <algorithm>
|
||||
|
||||
using namespace std;
|
||||
|
||||
@ -10,29 +13,31 @@ class Model
|
||||
{
|
||||
public:
|
||||
Model();
|
||||
|
||||
~Model();
|
||||
|
||||
const vector<Polygon3D>& GetPolygons();
|
||||
const vector<Vertex>& GetVertices();
|
||||
const vector<Matrix>& GetPendingTransforms();
|
||||
const vector<Polygon3D>& GetPolygons(void);
|
||||
const vector<Vertex>& GetVertices(void);
|
||||
const vector<Matrix>& GetPendingTransforms(void);
|
||||
|
||||
size_t GetPolygonCount();
|
||||
size_t GetVerticesCount();
|
||||
size_t GetPendingTransformCount();
|
||||
size_t GetPolygonCount(void);
|
||||
size_t GetVerticesCount(void);
|
||||
size_t GetPendingTransformCount(void);
|
||||
|
||||
void AddVertex(float x, float y, float z);
|
||||
void AddPolygon(int index0, int index1, int index2);
|
||||
void EnqueueTransform(Matrix transform);
|
||||
void ClearPendingTransforms();
|
||||
|
||||
Polygon3D GetPolygon(int index);
|
||||
Vertex GetVertex(int polygonIndex, int vertexPolygonIndex);
|
||||
Vertex GetVertex(int index);
|
||||
const Polygon3D& GetPolygon(int index);
|
||||
const Vertex& GetVertex(int polygonIndex, int vertexPolygonIndex);
|
||||
const Vertex& GetVertex(int index);
|
||||
|
||||
void ApplyTransformToLocalVertices(const Matrix& transform);
|
||||
void ApplyTransformToTransformedVertices(const Matrix& transform);
|
||||
void DehomogenizeAllVertices();
|
||||
void DehomogenizeAllVertices(void);
|
||||
|
||||
void CalculateBackfaces(Camera& currentCamera);
|
||||
void Sort(void);
|
||||
|
||||
private:
|
||||
vector<Polygon3D> _polygons;
|
||||
|
Reference in New Issue
Block a user