Porte d'entrée, à ne pas utiliser pour sortir !

This commit is contained in:
Yoann 2012-01-20 08:23:38 +01:00
parent 98b907fb2c
commit 071a7b07ff
3 changed files with 23 additions and 12 deletions

View File

@ -45,10 +45,19 @@ bool EtageQuad::split() {
Quad mwh = ch.insetOpp(W,28);
Quad mnh = ch.inset(E,28).inset(W,28).insetOpp(N,28);
addChild(new MurQuad(me << 1,meh << 1,w[E]));
addChild(new MurQuad(mw >> 1,mwh >> 1,w[W]));
addChild(new MurQuad(mn,mnh,w[N]));
addChild(new MurQuad(ms >> 2,msh >> 2,w[S]));
QuadBool d = QuadBool(false,false,false,false);
if(etage == 0) {
if(w[E]) d[E] = true;
else if(w[W]) d[W] = true;
else if(w[N]) d[N] = true;
else if(w[S]) d[S] = true;
}
addChild(new MurQuad(me << 1,meh << 1,w[E]^d[E],false,false,d[E]));
addChild(new MurQuad(mw >> 1,mwh >> 1,w[W]^d[W],false,false,d[W]));
addChild(new MurQuad(mn,mnh,w[N]^d[N],false,false,d[N]));
addChild(new MurQuad(ms >> 2,msh >> 2,w[S]^d[S],false,false,d[S]));
}
addChild(new PlancherPlafond(c, PlancherPlafond::PLANCHER));
addChild(new PlancherPlafond(ch.offsetNormal(-10), PlancherPlafond::PLAFOND));

View File

@ -1,12 +1,13 @@
#include "all_includes.hh"
MurQuad::MurQuad(Quad _c, Quad _ch, bool _window, bool _top, bool _bottom) : Chose(), c(_c), ch(_ch), window(_window), top(_top), bottom(_bottom) {
MurQuad::MurQuad(Quad _c, Quad _ch, bool _window, bool _top, bool _bottom, bool _door)
: Chose(), c(_c), ch(_ch), window(_window), top(_top), bottom(_bottom), door(_door) {
addEntropy(c);
addEntropy(ch);
addEntropy((int)top);
addEntropy((int)bottom);
if(_window)
setWindow();
if(_window || _door)
setWindowOrDoor();
}
void MurQuad::getBoundingBoxPoints() {
@ -14,18 +15,18 @@ void MurQuad::getBoundingBoxPoints() {
addBBPoints(ch);
}
void MurQuad::setWindow() {
void MurQuad::setWindowOrDoor() {
Quad q = Quad(ch[NE],c[NE],c[NW],ch[NW]);
float lr = (q.length(S) - 120)/2.f;
Quad wFront = q.insetNESW(40,lr,120,lr);
Quad wFront = q.insetNESW(40,lr,(window ? 120 : 0),lr);
Quad wBack = wFront.offsetNormal(28);
windowPos = Quad(wFront[SE],wBack[SE],wBack[SW],wFront[SW]);
windowPosh = Quad(wFront[NE],wBack[NE],wBack[NW],wFront[NW]);
}
bool MurQuad::split() {
if(!window)
if(!(window || door))
return false;
float length = c.maxLengthNS();

View File

@ -12,14 +12,15 @@ private :
Quad windowPosh;
bool top;
bool bottom;
bool door;
public :
MurQuad(Quad c, Quad ch, bool _window=false, bool _top=false, bool _bottom=false);
MurQuad(Quad c, Quad ch, bool _window=false, bool _top=false, bool _bottom=false, bool _door=false);
virtual void triangulation();
virtual bool split();
virtual void getBoundingBoxPoints();
void setWindow();
void setWindowOrDoor();
};
class PlancherPlafond: public Chose {