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 city
all.cpp all.cpp
all_includes.hh.gch 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() { BatimentQuadMaisonBlock::BatimentQuadMaisonBlock(Vertex ne, Vertex se, Vertex sw, Vertex nw, int height) : Chose() {
addEntropy(ne, se, sw, nw); addEntropy(ne, se, sw, nw);
lctr = Vertex(ne.x-nw.x,se.y-ne.y,0.0f); lctr = Vertex(ne.x-nw.x,se.y-ne.y,0.0f);
this->ne = ne-lctr; c[NE] = ne;
this->se = se-lctr; c[SE] = se;
this-> sw = sw-lctr; c[SW] = sw;
this->nw = nw-lctr; c[NW] = nw;
this->height = height; this->height = height;
} }
@ -16,7 +16,14 @@ BatimentQuadMaisonBlock::~BatimentQuadMaisonBlock() {
} }
void BatimentQuadMaisonBlock::getBoundingBoxPoints() { 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() { bool BatimentQuadMaisonBlock::split() {
@ -25,10 +32,10 @@ bool BatimentQuadMaisonBlock::split() {
void BatimentQuadMaisonBlock::triangulation() { void BatimentQuadMaisonBlock::triangulation() {
//triangles.reserve(2); //triangles.reserve(2);
Vertex seh = se + Vertex(0,0,height); Vertex seh = c[SE] + Vertex(0,0,height);
Vertex swh = sw + Vertex(0,0,height); Vertex swh = c[SW] + Vertex(0,0,height);
Vertex nwh = nw + Vertex(0,0,height); Vertex nwh = c[NW] + Vertex(0,0,height);
Vertex neh = ne + 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°. // RectangleRoutes est un quadrilatère de routes avec des angles aux coins égaux à 90°.
class BatimentQuadMaisonBlock : public Chose { class BatimentQuadMaisonBlock : public Chose {
private : private :
Vertex ne; Vertex c[4];
Vertex se;
Vertex sw;
Vertex nw;
int height; int height;
public : public :

View File

@ -15,7 +15,14 @@ BatimentQuadMaisonPont::~BatimentQuadMaisonPont() {
} }
void BatimentQuadMaisonPont::getBoundingBoxPoints() { 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() { bool BatimentQuadMaisonPont::split() {

View File

@ -15,7 +15,14 @@ BatimentQuadPont::~BatimentQuadPont() {
} }
void BatimentQuadPont::getBoundingBoxPoints() { 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() { bool BatimentQuadPont::split() {