Rectification d'un bug sur les maisons avec pont.

This commit is contained in:
Yoann 2012-01-05 11:12:51 +01:00
parent 800338bfaa
commit dde802c8fc
2 changed files with 8 additions and 8 deletions

View File

@ -11,7 +11,7 @@ int main() {
Chose* c = QuartierQuad::factory(Chose::initialSeed, 0, Quad(ne, se, sw, nw));
c->triangulation();
c->updateAABB();
new View(c);
return 0;
}

View File

@ -10,11 +10,11 @@ void BatimentQuadMaisonPont::getBoundingBoxPoints() {
}
bool BatimentQuadMaisonPont::split() {
Quad q = Quad(c[NE],c[SE],c[SW],c[NW]);
Quad q = c;
q.makeParallelogram();
if(Segment(q.c[0],q.c[3]).length() < Segment(q.c[0],q.c[1]).length())
q = Quad(q.c[1],q.c[2],q.c[3],q.c[0]);
float partLength = Segment(q.c[0],q.c[3]).length() / 3;
q = q >> 1;
float partLength = Segment(q.c[0],q.c[3]).length() / 3.;
int partHeight = 2.5*height/3.;
Quad qa = q;
Quad qb = q;
@ -25,10 +25,10 @@ bool BatimentQuadMaisonPont::split() {
qc.offset(E, -partLength);
qc.offset(W, -partLength);
addChild(new BatimentQuadJardin(c << 1));
addChild(new BatimentQuadBlock(qa >> 1,partHeight));
addChild(new BatimentQuadBlock(qb >> 1,partHeight));
addChild(new BatimentQuadBlock((qh + Vertex(0,0,partHeight)) >> 1,partHeight));
addChild(new BatimentQuadJardin(c));
addChild(new BatimentQuadBlock(qa,partHeight));
addChild(new BatimentQuadBlock(qb,partHeight));
addChild(new BatimentQuadBlock((qh + Vertex(0,0,partHeight)),partHeight));
addChild(new BatimentQuadPont(qc,partHeight));
addChild(new BatimentQuadToit(qh + Vertex(0,0,2*partHeight),150));