commit b4dc6432d0a5af72f310bf47f9a08dad9f040b63
parent e06a78df824abd831cd68361045f5255b5a771fb
Author: Yoann <yoann.b87@voila.fr>
Date: Wed, 18 Jan 2012 19:26:14 +0100
Detection des batiments entièrement entourés, mais pas encore au point.
Diffstat:
2 files changed, 10 insertions(+), 7 deletions(-)
diff --git a/rules/architecture/batiment.cpp b/rules/architecture/batiment.cpp
@@ -6,26 +6,29 @@ BatimentQuad_::BatimentQuad_(Quad _c, bool _isSub, bool _we, bool _ws, bool _ww,
}
bool BatimentQuad_::split() {
- int minSurface = 100 * 100 * 100;
+ int minSurface = 100 * 100 * 10;
Quad q = c;
//Quad q = c << c.maxLengthSide();
if(c.maxLengthNS() < c.maxLengthEW()) {
q = c >> 1;
bool t = we;
- we = wn; wn = ww; ww = ws; ws = t;
+ we = ws; ws = ww; ww = wn; wn = t;
}
std::cout << "w : " << we << " " << ws << " " << ww << " " << wn << std::endl;
if((we || ws || ww || wn) && q.surface() > 2 * minSurface) {
- Vertex n = Segment(q[NW], q[NE]).randomPos(seed, 0, 3.f/8.f, 5.f/8.f);
- Vertex s = Segment(q[SE], q[SW]).randomPos(seed, 1, 3.f/8.f, 5.f/8.f);
+ Vertex n = Segment(q[NW], q[NE]).randomPos(seed, 0, 1.f/2.f, 1.f/2.f);
+ Vertex s = Segment(q[SE], q[SW]).randomPos(seed, 1, 1.f/2.f, 1.f/2.f);
addChild(new BatimentQuad_(Quad(q[NE], q[SE], s, n), true,we&&true,ws&&true,false,wn&&true));
- addChild(new BatimentQuad_(Quad(q[SW], q[NW], n, s), true,false,ws&&true,ww&&true,wn&&true));
+ addChild(new BatimentQuad_(Quad(n, s,q[SW],q[NW]), true,false,ws&&true,ww&&true,wn&&true));
} else {
Quad ch = c.offsetNormal(Dimensions::hauteurEtage);
ch = ch.insetNESW(80);
- addChild(new ToitQuad(ch, Dimensions::hauteurToit));
+ if(we || ws || ww || wn)
+ addChild(new ToitQuad(ch, Dimensions::hauteurToit));
+ else
+ addChild(new BatimentQuadJardin(ch));
}
return true;
diff --git a/rules/architecture/couleursDimensions.hh b/rules/architecture/couleursDimensions.hh
@@ -20,7 +20,7 @@ public:
);
};
static const unsigned int mur = 0xF1E3AD;
- static const unsigned int toit = 0x961618;
+ static const unsigned int toit = 0xF0F0F0;//0x961618;
static const unsigned int route = 0x363636;
static const unsigned int trottoir = 0x666666;
static const unsigned int bordureTrottoir = 0xAAAAAA;