Compare commits

...

2 Commits

Author SHA1 Message Date
Georges Dupéron
b7e3683fbf Quickly fixed some build errors. 2014-09-25 01:36:57 +02:00
Georges Dupéron
10aed0d2b1 Previous version didn't compile due to a few missing lines. 2012-11-01 16:01:44 +01:00
6 changed files with 11 additions and 8 deletions

View File

@ -24,7 +24,7 @@ $(EXECUTABLE): $(SOURCES) all_includes.hh.gch Makefile
@echo "#define _ALL_CPP_">> all.cpp @echo "#define _ALL_CPP_">> all.cpp
@$(foreach FILE,$(SOURCES),echo '#include "'"$(FILE)"'"' >> all.cpp;) @$(foreach FILE,$(SOURCES),echo '#include "'"$(FILE)"'"' >> all.cpp;)
@echo "#endif">> all.cpp @echo "#endif">> all.cpp
$(CXX) $(LIBS) $(CFLAGS) all.cpp -o $@ $(CXX) all.cpp $(LIBS) $(CFLAGS) -o $@
@rm all.cpp @rm all.cpp
all_includes.hh.gch: $(HEADERS) Makefile all_includes.hh.gch: $(HEADERS) Makefile

View File

@ -60,9 +60,9 @@ void Lod::setCamera(Vertex newCamera) {
void Lod::doSplit(Chose* c) { void Lod::doSplit(Chose* c) {
c->split(); c->split();
std::vector<Chose*>::iterator it; std::vector<Chose*>::iterator it;
bool mergeCube = false; ////bool mergeCube = false; // Started to work again on the project, a new warning detected this.
for (it = c->children.begin(); it != c->children.end(); ++it) { for (it = c->children.begin(); it != c->children.end(); ++it) {
mergeCube = true; ////mergeCube = true; // Started to work again on the project, a new warning detected this.
(*it)->triangulation(); (*it)->triangulation();
(*it)->updateAABB(); (*it)->updateAABB();
// (*it)->drawAABB(); // (*it)->drawAABB();

View File

@ -147,8 +147,11 @@ void Chose::updateAABB() {
lod.firstBBPoint = true; lod.firstBBPoint = true;
getBoundingBoxPoints(); getBoundingBoxPoints();
float size[3]; float size[3];
for (int i = 0; i < 3; i++) float center[3];
for (int i = 0; i < 3; i++) {
size[i] = lod.aabb[2*i+1] - lod.aabb[2*i]; size[i] = lod.aabb[2*i+1] - lod.aabb[2*i];
center[i] = (lod.aabb[2*i] + lod.aabb[2*i+1])/2.f;
}
float areaFacing[3]; float areaFacing[3];
for (int i = 0; i < 3; i++) for (int i = 0; i < 3; i++)
areaFacing[i] = size[(i+1)%3]*size[(i+1)%3]; areaFacing[i] = size[(i+1)%3]*size[(i+1)%3];

View File

@ -30,7 +30,7 @@ protected :
virtual void getBoundingBoxPoints() = 0; virtual void getBoundingBoxPoints() = 0;
virtual float LODFactor(); virtual float LODFactor();
Chose(); Chose();
~Chose(); virtual ~Chose();
inline void addEntropy(unsigned int x1) { inline void addEntropy(unsigned int x1) {
seed = hash2(seed, x1); seed = hash2(seed, x1);
} }

View File

@ -2,7 +2,7 @@
const unsigned int Couleurs::fog = mix(cielHaut, cielBas, 0.5); const unsigned int Couleurs::fog = mix(cielHaut, cielBas, 0.5);
const float Dimensions::splitFactor = 1.f; const float Dimensions::splitFactor = 3.f;
const float Dimensions::mergeFactor = 1.25f; const float Dimensions::mergeFactor = 4.f;
const float Dimensions::frontFrustum = 1.f; const float Dimensions::frontFrustum = 1.f;
const float Dimensions::backFrustum = 4000 * 100; // 4km const float Dimensions::backFrustum = 4000 * 100; // 4km

View File

@ -45,7 +45,7 @@ void MurQuad::split() {
Quad righth = Quad(windowPosh[NW],windowPosh[SW],ch[SW],ch[NW]); Quad righth = Quad(windowPosh[NW],windowPosh[SW],ch[SW],ch[NW]);
Quad left = Quad(c[NE],c[SE],windowPos[SE],windowPos[NE]); Quad left = Quad(c[NE],c[SE],windowPos[SE],windowPos[NE]);
Quad lefth = Quad(ch[NE],ch[SE],windowPosh[SE],windowPosh[NE]); Quad lefth = Quad(ch[NE],ch[SE],windowPosh[SE],windowPosh[NE]);
Quad top = Quad(windowPosh[NE],windowPosh[NW],windowPosh[SW],windowPosh[SE]); ////Quad top = Quad(windowPosh[NE],windowPosh[NW],windowPosh[SW],windowPosh[SE]); // Started to work again on the project, a new warning detected this.
if (!door) addChild(new MurQuad(c,windowPos,false, true, false)); if (!door) addChild(new MurQuad(c,windowPos,false, true, false));
addChild(new MurQuad(windowPosh,ch, false, false, true)); addChild(new MurQuad(windowPosh,ch, false, false, true));