-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathMesh.cpp
34 lines (29 loc) · 981 Bytes
/
Mesh.cpp
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
#include <vector>
#include "Triangle.h"
#include "Mesh.h"
#include <iostream>
#include <iomanip>
using namespace std;
Mesh::Mesh() {}
// TODO bunu burdan al
Mesh::Mesh(int meshId, int type, int numberOfTransformations,
vector<int> transformationIds,
vector<char> transformationTypes,
int numberOfTriangles,
vector<Triangle> triangles)
{
this->meshId = meshId;
this->type = type;
this->numberOfTransformations = numberOfTransformations;
this->numberOfTriangles = numberOfTriangles;
this->transformationIds = transformationIds;
this->transformationTypes = transformationTypes;
this->triangles = triangles;
}
void Mesh::computeModelingTransform() {
Matrix4 modelingMatrix = getIdentityMatrix();
for(auto transformation : this->transformations) {
modelingMatrix = multiplyMatrixWithMatrix(transformation->matrix, modelingMatrix);
}
this->modelingTransform = modelingMatrix;
}