Merge branch 'master' of github:jsmaniac/2011-m2s3-city-builder
Conflicts: geometry/quad.hh
This commit is contained in:
commit
ea5cc15c7e
|
@ -54,6 +54,19 @@ Quad Quad::makeParallelogram() {
|
||||||
return Quad(c[0],c[1],c[2],c[3]);
|
return Quad(c[0],c[1],c[2],c[3]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
float Quad::length(Cardinal cn) {
|
||||||
|
if(cn == N)
|
||||||
|
return Segment(c[NW],c[NE]).length();
|
||||||
|
else if(cn == S)
|
||||||
|
return Segment(c[SW],c[SE]).length();
|
||||||
|
else if(cn == E)
|
||||||
|
return Segment(c[NE],c[SE]).length();
|
||||||
|
else if(cn == W)
|
||||||
|
return Segment(c[SW],c[NW]).length();
|
||||||
|
|
||||||
|
return 0;
|
||||||
|
}
|
||||||
|
|
||||||
float Quad::minLengthNS() {
|
float Quad::minLengthNS() {
|
||||||
return std::min(
|
return std::min(
|
||||||
Segment(c[NW],c[NE]).length(),
|
Segment(c[NW],c[NE]).length(),
|
||||||
|
|
|
@ -27,6 +27,7 @@ class Quad {
|
||||||
Quad inset(Cardinal side, float offset) const;
|
Quad inset(Cardinal side, float offset) const;
|
||||||
Quad insetNESW(float offsetN, float offsetE, float offsetS, float offsetW) const;
|
Quad insetNESW(float offsetN, float offsetE, float offsetS, float offsetW) const;
|
||||||
Quad insetNESW(float offset) const;
|
Quad insetNESW(float offset) const;
|
||||||
|
float length(Cardinal c);
|
||||||
float minLengthNS();
|
float minLengthNS();
|
||||||
float minLengthEW();
|
float minLengthEW();
|
||||||
float maxLengthNS();
|
float maxLengthNS();
|
||||||
|
|
|
@ -9,6 +9,17 @@ void BatimentQuadBlock::getBoundingBoxPoints() {
|
||||||
addBBPoints(c + Vertex(0,0,height)); // TODO
|
addBBPoints(c + Vertex(0,0,height)); // TODO
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool BatimentQuadBlock::split() {
|
||||||
|
Quad me = c;
|
||||||
|
Quad ms = c;
|
||||||
|
Quad mw = c;
|
||||||
|
Quad mn = c;
|
||||||
|
|
||||||
|
me[NW] = me[NE] + ((me[NW] - me[NW]) / me.length(N))*150;
|
||||||
|
//TODO les autres côtés.
|
||||||
|
return false;
|
||||||
|
}
|
||||||
|
|
||||||
void BatimentQuadBlock::triangulation() {
|
void BatimentQuadBlock::triangulation() {
|
||||||
addGPUOcto(c, c + Vertex(0,0,height), 0xF1, 0xE0, 0xE0);
|
addGPUOcto(c, c + Vertex(0,0,height), 0xF1, 0xE0, 0xE0);
|
||||||
}
|
}
|
||||||
|
|
|
@ -11,6 +11,7 @@ class BatimentQuadBlock : public Chose {
|
||||||
|
|
||||||
public :
|
public :
|
||||||
BatimentQuadBlock(Quad c, int height);
|
BatimentQuadBlock(Quad c, int height);
|
||||||
|
virtual bool split();
|
||||||
virtual void triangulation();
|
virtual void triangulation();
|
||||||
virtual void getBoundingBoxPoints();
|
virtual void getBoundingBoxPoints();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in New Issue
Block a user