Merge branch 'master' of github.com:jsmaniac/2011-m2s3-city-builder

This commit is contained in:
Georges Dupéron 2011-12-22 15:49:56 +01:00
commit acc706970c
5 changed files with 35 additions and 17 deletions

2
.gitignore vendored
View File

@ -1,4 +1,4 @@
city
all.cpp
all_includes.hh.gch
city-builder/*
city-builder

View File

@ -3,10 +3,10 @@
BatimentQuadMaisonBlock::BatimentQuadMaisonBlock(Vertex ne, Vertex se, Vertex sw, Vertex nw, int height) : Chose() {
addEntropy(ne, se, sw, nw);
lctr = Vertex(ne.x-nw.x,se.y-ne.y,0.0f);
this->ne = ne-lctr;
this->se = se-lctr;
this-> sw = sw-lctr;
this->nw = nw-lctr;
c[NE] = ne;
c[SE] = se;
c[SW] = sw;
c[NW] = nw;
this->height = height;
}
@ -16,7 +16,14 @@ BatimentQuadMaisonBlock::~BatimentQuadMaisonBlock() {
}
void BatimentQuadMaisonBlock::getBoundingBoxPoints() {
// TODO
addBBPoint(c[NE]);
addBBPoint(c[SE]);
addBBPoint(c[SW]);
addBBPoint(c[NW]);
addBBPoint(c[NE] + Vertex(0,0,height)); // TODO
addBBPoint(c[SE] + Vertex(0,0,height));
addBBPoint(c[SW] + Vertex(0,0,height));
addBBPoint(c[NW] + Vertex(0,0,height));// TODO
}
bool BatimentQuadMaisonBlock::split() {
@ -25,10 +32,10 @@ bool BatimentQuadMaisonBlock::split() {
void BatimentQuadMaisonBlock::triangulation() {
//triangles.reserve(2);
Vertex seh = se + Vertex(0,0,height);
Vertex swh = sw + Vertex(0,0,height);
Vertex nwh = nw + Vertex(0,0,height);
Vertex neh = ne + Vertex(0,0,height);
Vertex seh = c[SE] + Vertex(0,0,height);
Vertex swh = c[SW] + Vertex(0,0,height);
Vertex nwh = c[NW] + Vertex(0,0,height);
Vertex neh = c[NE] + Vertex(0,0,height);
addOcto(lctr+se,lctr+sw,lctr+nw,lctr+ne,lctr+seh,lctr+swh,lctr+nwh,lctr+neh,0xFF,0x36,0x00);
addOcto(c[SE],c[SW],c[NW],c[NE],seh,swh,nwh,neh,0xFF,0x36,0x00);
}

View File

@ -6,10 +6,7 @@
// RectangleRoutes est un quadrilatère de routes avec des angles aux coins égaux à 90°.
class BatimentQuadMaisonBlock : public Chose {
private :
Vertex ne;
Vertex se;
Vertex sw;
Vertex nw;
Vertex c[4];
int height;
public :

View File

@ -15,7 +15,14 @@ BatimentQuadMaisonPont::~BatimentQuadMaisonPont() {
}
void BatimentQuadMaisonPont::getBoundingBoxPoints() {
// TODO
addBBPoint(c[NE]);
addBBPoint(c[SE]);
addBBPoint(c[SW]);
addBBPoint(c[NW]);
addBBPoint(c[NE] + Vertex(0,0,height)); // TODO
addBBPoint(c[SE] + Vertex(0,0,height));
addBBPoint(c[SW] + Vertex(0,0,height));
addBBPoint(c[NW] + Vertex(0,0,height));
}
bool BatimentQuadMaisonPont::split() {

View File

@ -15,7 +15,14 @@ BatimentQuadPont::~BatimentQuadPont() {
}
void BatimentQuadPont::getBoundingBoxPoints() {
// TODO !
addBBPoint(c[NE]);
addBBPoint(c[SE]);
addBBPoint(c[SW]);
addBBPoint(c[NW]);
addBBPoint(c[NE] + Vertex(0,0,height)); // TODO
addBBPoint(c[SE] + Vertex(0,0,height));
addBBPoint(c[SW] + Vertex(0,0,height));
addBBPoint(c[NW] + Vertex(0,0,height));
}
bool BatimentQuadPont::split() {