commit 959a18833540426d14b8daa4e8e0004290dcdf85
parent 2db9bb222ae7e3981f40bd674bb55b09cfdcd827
Author: Yoann <yoann.b87@voila.fr>
Date: Sun, 11 Dec 2011 14:03:56 +0100
Début de l'ajout des trottoirs au routes.
Diffstat:
2 files changed, 32 insertions(+), 1 deletion(-)
diff --git a/rules/route.cpp b/rules/route.cpp
@@ -17,8 +17,38 @@ std::ostream& operator<<(std::ostream& os, const Route& r) {
return os << "Route " << r.ne << "-" << r.se << "-" << r.sw << "-" << r.nw;
}
+
void Route::triangulation() {
triangles.reserve(2);
addTriangle(new Triangle(ne, nw, sw, 0x36, 0x36, 0x36));
addTriangle(new Triangle(sw, se, ne, 0x36, 0x36, 0x36));
}
+
+// Version avec trottoirs.
+/*void Route::triangulation() {
+ triangles.reserve(6);
+ Vertex nne, nnw, nse, nsw; // Nouvel emplacement de la route.
+ Vertex pvLne, pvLnw, pvLsw, pvLse; // Trottoir Nord (pv => pavement)
+ Vertex pvRne, pvRnw, pvRsw, pvRse; // Trottoir Sud (pv => pavement)
+
+ pvLnw = nw;
+ pvLsw = sw;
+ pvRne = ne;
+ pvRse = se;
+ pvLne = nw + ((ne - nw)/6);
+ pvLse = sw + ((se - sw)/6);
+ pvRnw = ne - ((ne - nw)/6);
+ pvRsw = se - ((se - sw)/6);
+ nnw = pvLne;
+ nsw = pvLse;
+ nne = pvRnw;
+ nse = pvRsw;
+
+ addTriangle(new Triangle(pvLne, pvLnw, pvLsw, 0xEE, 0xEE, 0x00));
+ addTriangle(new Triangle(pvLsw, pvLse, pvLne, 0xEE, 0xEE, 0x00));
+ addTriangle(new Triangle(pvRne, pvRnw, pvRsw, 0xEE, 0xEE, 0x00));
+ addTriangle(new Triangle(pvRsw, pvRse, pvRne, 0xEE, 0xEE, 0x00));
+
+ addTriangle(new Triangle(nne, nnw, nsw, 0x36, 0x36, 0x36));
+ addTriangle(new Triangle(nsw, nse, nne, 0x36, 0x36, 0x36));
+}*/
diff --git a/view.cpp b/view.cpp
@@ -1,7 +1,8 @@
#include "all_includes.hh"
// camera(Camera(Vertexf(1000,1000,2000),45,100,1000,0.6)
-View::View(Chose* root) : root(root), camera(Camera(Vertexf(13126,19103,30539),90,179,1000,0.6)) {
+//View::View(Chose* root) : root(root), camera(Camera(Vertexf(13126,19103,30539),90,179,1000,0.6)) {
+View::View(Chose* root) : root(root), camera(Camera(Vertexf(1493,18122,2246),13,179,1000,0.6)) {
initWindow();
mainLoop();
}