Rectification d'un bug sur les maisons avec pont.
This commit is contained in:
parent
800338bfaa
commit
dde802c8fc
2
main.cpp
2
main.cpp
|
@ -11,7 +11,7 @@ int main() {
|
||||||
Chose* c = QuartierQuad::factory(Chose::initialSeed, 0, Quad(ne, se, sw, nw));
|
Chose* c = QuartierQuad::factory(Chose::initialSeed, 0, Quad(ne, se, sw, nw));
|
||||||
c->triangulation();
|
c->triangulation();
|
||||||
c->updateAABB();
|
c->updateAABB();
|
||||||
|
|
||||||
new View(c);
|
new View(c);
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
|
|
|
@ -10,11 +10,11 @@ void BatimentQuadMaisonPont::getBoundingBoxPoints() {
|
||||||
}
|
}
|
||||||
|
|
||||||
bool BatimentQuadMaisonPont::split() {
|
bool BatimentQuadMaisonPont::split() {
|
||||||
Quad q = Quad(c[NE],c[SE],c[SW],c[NW]);
|
Quad q = c;
|
||||||
q.makeParallelogram();
|
q.makeParallelogram();
|
||||||
if(Segment(q.c[0],q.c[3]).length() < Segment(q.c[0],q.c[1]).length())
|
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]);
|
q = q >> 1;
|
||||||
float partLength = Segment(q.c[0],q.c[3]).length() / 3;
|
float partLength = Segment(q.c[0],q.c[3]).length() / 3.;
|
||||||
int partHeight = 2.5*height/3.;
|
int partHeight = 2.5*height/3.;
|
||||||
Quad qa = q;
|
Quad qa = q;
|
||||||
Quad qb = q;
|
Quad qb = q;
|
||||||
|
@ -25,10 +25,10 @@ bool BatimentQuadMaisonPont::split() {
|
||||||
qc.offset(E, -partLength);
|
qc.offset(E, -partLength);
|
||||||
qc.offset(W, -partLength);
|
qc.offset(W, -partLength);
|
||||||
|
|
||||||
addChild(new BatimentQuadJardin(c << 1));
|
addChild(new BatimentQuadJardin(c));
|
||||||
addChild(new BatimentQuadBlock(qa >> 1,partHeight));
|
addChild(new BatimentQuadBlock(qa,partHeight));
|
||||||
addChild(new BatimentQuadBlock(qb >> 1,partHeight));
|
addChild(new BatimentQuadBlock(qb,partHeight));
|
||||||
addChild(new BatimentQuadBlock((qh + Vertex(0,0,partHeight)) >> 1,partHeight));
|
addChild(new BatimentQuadBlock((qh + Vertex(0,0,partHeight)),partHeight));
|
||||||
addChild(new BatimentQuadPont(qc,partHeight));
|
addChild(new BatimentQuadPont(qc,partHeight));
|
||||||
addChild(new BatimentQuadToit(qh + Vertex(0,0,2*partHeight),150));
|
addChild(new BatimentQuadToit(qh + Vertex(0,0,2*partHeight),150));
|
||||||
|
|
||||||
|
|
Loading…
Reference in New Issue
Block a user