Merge branch 'master' of github:jsmaniac/2011-m2s3-city-builder
Conflicts: all_includes.hh rules/batiment/batimentquadmaisonpont.cpp
This commit is contained in:
commit
2dafdf60dd
|
@ -44,6 +44,8 @@ class Chose;
|
|||
#include "rules/batiment/batimentquadblock.hh"
|
||||
#include "rules/batiment/batimentquadtoit.hh"
|
||||
#include "rules/batiment/batimenttri.hh"
|
||||
#include "rules/batiment/batimentquadmur.hh"
|
||||
#include "rules/batiment/batimentquadfenetre.hh"
|
||||
|
||||
#include "rules/quartier/quartierquad.hh"
|
||||
#include "rules/quartier/quartierquadangle.hh"
|
||||
|
|
2
main.cpp
2
main.cpp
|
@ -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;
|
||||
}
|
||||
|
|
14
rules/batiment/batimentquadfenetre.cpp
Normal file
14
rules/batiment/batimentquadfenetre.cpp
Normal file
|
@ -0,0 +1,14 @@
|
|||
#include "all_includes.hh"
|
||||
|
||||
BatimentQuadFenetre::BatimentQuadFenetre(Quad c, int height) : Chose(), c(c), height(height) {
|
||||
addEntropy(c);
|
||||
}
|
||||
|
||||
void BatimentQuadFenetre::getBoundingBoxPoints() {
|
||||
addBBPoints(c);
|
||||
addBBPoints(c + Vertex(0,0,height));
|
||||
}
|
||||
|
||||
void BatimentQuadFenetre::triangulation() {
|
||||
// Vide laisse un trou à la place de la fenêtre.
|
||||
}
|
18
rules/batiment/batimentquadfenetre.hh
Normal file
18
rules/batiment/batimentquadfenetre.hh
Normal file
|
@ -0,0 +1,18 @@
|
|||
#ifndef _RULES_BATIMENT_BATIMENTQUADFENETRE_HH_
|
||||
#define _RULES_BATIMENT_BATIMENTQUADFENETRE_HH_
|
||||
|
||||
#include "all_includes.hh"
|
||||
|
||||
class BatimentQuadFenetre: public Chose {
|
||||
private :
|
||||
Quad c;
|
||||
int height;
|
||||
|
||||
public :
|
||||
|
||||
BatimentQuadFenetre(Quad c, int height);
|
||||
virtual void triangulation();
|
||||
virtual void getBoundingBoxPoints();
|
||||
};
|
||||
|
||||
#endif
|
|
@ -10,9 +10,9 @@ 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[NE],q[NW]).length() < Segment(q[NE],q[SE]).length())
|
||||
if(Segment(q[NE],q[NW]).length() < Segment(q[NE],q[SE]).length())
|
||||
q = q << 1;
|
||||
float partLength = Segment(q[NE],q[NW]).length() / 3;
|
||||
int partHeight = 2.5*height/3.;
|
||||
|
@ -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));
|
||||
|
||||
|
|
14
rules/batiment/batimentquadmur.cpp
Normal file
14
rules/batiment/batimentquadmur.cpp
Normal file
|
@ -0,0 +1,14 @@
|
|||
#include "all_includes.hh"
|
||||
|
||||
BatimentQuadMur::BatimentQuadMur(Quad c, int height) : Chose(), c(c), height(height) {
|
||||
addEntropy(c);
|
||||
}
|
||||
|
||||
void BatimentQuadMur::getBoundingBoxPoints() {
|
||||
addBBPoints(c);
|
||||
addBBPoints(c + Vertex(0,0,height));
|
||||
}
|
||||
|
||||
void BatimentQuadMur::triangulation() {
|
||||
addGPUOcto(c, c + Vertex(0,0,height), 0xF1, 0xE0, 0xE0);
|
||||
}
|
18
rules/batiment/batimentquadmur.hh
Normal file
18
rules/batiment/batimentquadmur.hh
Normal file
|
@ -0,0 +1,18 @@
|
|||
#ifndef _RULES_BATIMENT_BATIMENTQUADMUR_HH_
|
||||
#define _RULES_BATIMENT_BATIMENTQUADMUR_HH_
|
||||
|
||||
#include "all_includes.hh"
|
||||
|
||||
class BatimentQuadMur: public Chose {
|
||||
private :
|
||||
Quad c;
|
||||
int height;
|
||||
|
||||
public :
|
||||
|
||||
BatimentQuadMur(Quad c, int height);
|
||||
virtual void triangulation();
|
||||
virtual void getBoundingBoxPoints();
|
||||
};
|
||||
|
||||
#endif
|
Loading…
Reference in New Issue
Block a user