Merge branch 'master' of https://github.com/jsmaniac/2011-m2s3-city-builder
This commit is contained in:
commit
4ab8114eb1
2
main.cpp
2
main.cpp
|
@ -6,7 +6,7 @@ int main(int argc, char* argv[]) {
|
|||
Chose::initialSeed = (unsigned int) atoi(argv[1]);
|
||||
|
||||
std::cout << "Initial seed = " << Chose::initialSeed << std::endl;
|
||||
float size = 500 * 100;
|
||||
float size = 200 * 100;
|
||||
Vertex ne(size, size, 0);
|
||||
Vertex se(size, 0, 0);
|
||||
Vertex sw(0, 0, 0);
|
||||
|
|
|
@ -20,11 +20,17 @@ bool BatimentQuad_::split() {
|
|||
addChild(new BatimentQuad_(Quad(q[SE], s, n, q[NE]), true, QuadBool(qb[E],qb[S],false,qb[N])));
|
||||
addChild(new BatimentQuad_(Quad(q[NW], n, s, q[SW]), true, QuadBool(qb[W],qb[N],false,qb[S])));
|
||||
} else {
|
||||
Quad ch = c.offsetNormal(Dimensions::hauteurEtage);
|
||||
ch = ch.insetNESW(30);
|
||||
c = c.insetNESW(30);
|
||||
addChild(new ToitQuad(ch, Dimensions::hauteurToit));
|
||||
addChild(new EtageQuad(c,ch));
|
||||
float randEtages = floatInRange(seed, 2, 0.f, 1.f);
|
||||
int nbEtages = 1 + (int)(randEtages * randEtages * (Dimensions::maxEtages - 1));
|
||||
Quad q = c;
|
||||
//ch = ch.insetNESW(30);
|
||||
Quad qh;
|
||||
for (int i = 0; i < nbEtages; i++) {
|
||||
qh = q.offsetNormal(floatInRange(seed, 3+i, Dimensions::hauteurEtage*0.9f, Dimensions::hauteurEtage*1.1f));
|
||||
addChild(new EtageQuad(q,qh));
|
||||
q = qh;
|
||||
}
|
||||
addChild(new ToitQuad(qh, Dimensions::hauteurToit));
|
||||
}
|
||||
} else {
|
||||
addChild(new TerrainQuad(c));
|
||||
|
|
|
@ -20,6 +20,8 @@ public:
|
|||
);
|
||||
};
|
||||
static const unsigned int mur = 0xF1E3AD;
|
||||
static const unsigned int plafond = mur;
|
||||
static const unsigned int plancher = mur;
|
||||
static const unsigned int toit = 0x961618;
|
||||
static const unsigned int route = 0x363636;
|
||||
static const unsigned int trottoir = 0x666666;
|
||||
|
@ -37,6 +39,7 @@ public:
|
|||
static const unsigned int largeurRoute = 200;
|
||||
static const unsigned int largeurTrottoir = 140;
|
||||
static const unsigned int hauteurEtage = 300;
|
||||
static const unsigned int maxEtages = 5;
|
||||
static const unsigned int hauteurToit = 200;
|
||||
static const unsigned int hauteurTrottoir = 20;
|
||||
static const unsigned int hauteurMaxBatiment = hauteurTrottoir + hauteurEtage + hauteurToit;
|
||||
|
|
|
@ -30,5 +30,7 @@ bool EtageQuad::split() {
|
|||
}
|
||||
|
||||
void EtageQuad::triangulation() {
|
||||
addGPUOcto(c,ch, 0xF1E0E0);
|
||||
addGPUFourQuads(c,ch, Couleurs::mur);
|
||||
addGPUQuad(ch.offsetNormal(-30), Couleurs::plafond);
|
||||
addGPUQuad(c, Couleurs::plancher);
|
||||
}
|
||||
|
|
|
@ -141,8 +141,9 @@ void Chose::addBBPoints(const Quad q, float height) {
|
|||
}
|
||||
|
||||
void Chose::updateAABB() {
|
||||
float splitFactor = 5.f * LODFactor();
|
||||
float mergeFactor = 6.f * LODFactor();
|
||||
// TODO : Debug : devrait être 5.f, 6.f
|
||||
float splitFactor = 2.f * LODFactor();
|
||||
float mergeFactor = 3.f * LODFactor();
|
||||
float nonFacingFactor = 2.f/3.f;
|
||||
lod.firstBBPoint = true;
|
||||
getBoundingBoxPoints();
|
||||
|
|
Loading…
Reference in New Issue
Block a user