-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathEnvironmentNode.cpp
43 lines (38 loc) · 1.06 KB
/
EnvironmentNode.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
35
36
37
38
39
40
41
#include "EnvironmentNode.h"
#include "Util.h"
#include "math/common.h"
#include "Log.h"
using namespace std;
void EnvironmentNode :: renderSelf(IPartitioner* partitioner, unsigned int flags) const
{
//auto& meshes = *getMeshes_c();
//foreach(const Mesh* m, meshes)
// m->render(flags);
//
for(list<shared_ptr<Mesh>>::const_iterator itr = getMeshes_c()->begin();
itr != getMeshes_c()->end();
itr++)
{
(*itr)->render(flags);
}
}
void EnvironmentNode :: recalculate()
{
for(list<shared_ptr<Mesh>>::const_iterator itr = getMeshes_c()->begin();
itr != getMeshes_c()->end();
++itr)
{
for(vector<glm::vec3>::const_iterator jtr = (*itr)->vertices.begin();
jtr != (*itr)->vertices.end();
++jtr)
{
for(int i=0; i<3; i++)
{
if((*jtr)[i] > m_Box.max[i])
m_Box.max[i] = (*jtr)[i];
else if((*jtr)[i] < m_Box.min[i])
m_Box.min[i] = (*jtr)[i];
}
}
}
}