projects
/
demo
/ blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
shortlog
|
log
|
commit
|
commitdiff
|
tree
history
|
raw
|
HEAD
added morphing to the cow
[demo]
/
src
/
mesh.cc
1
#include "mesh.h"
2
3
Mesh::Mesh()
4
{
5
vdata_valid = false;
6
}
7
8
Mesh::~Mesh()
9
{
10
indices.clear();
11
vertices.clear();
12
normals.clear();
13
}
14
15
void Mesh::transform(const Mat4 &mat)
16
{
17
Mat4 normal_mat = mat.upper3x3();
18
for(size_t i=0; i<vertices.size(); i++) {
19
vertices[i] = mat * vertices[i];
20
normals[i] = normal_mat * normals[i];
21
}
22
invalidate();
23
}
24
25
void Mesh::invalidate()
26
{
27
vdata_valid = false;
28
}