From 15626bfe9098070808ca90160a8df8049f923e9b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Georges=20Dup=C3=A9ron?= Date: Wed, 18 Jan 2012 16:57:54 +0100 Subject: [PATCH] =?UTF-8?q?Suppression=20d'une=20fonction=202D=20qui=20n'?= =?UTF-8?q?=C3=A9tait=20plus=20utilis=C3=A9e.?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- geometry/vertex.cpp | 13 ------------- geometry/vertex.hh | 1 - 2 files changed, 14 deletions(-) diff --git a/geometry/vertex.cpp b/geometry/vertex.cpp index 5ca7ce3..e46c526 100644 --- a/geometry/vertex.cpp +++ b/geometry/vertex.cpp @@ -10,19 +10,6 @@ Vertex::Vertex(float _x, float _y, float _z): x(_x), y(_y), z(_z) { float Vertex::norm() const { return std::sqrt(x*x + y*y + z*z); } -// TODO : Ce code ne marche qu'en 2D ! -Vertex intersection(Vertex a, Vertex b, Vertex c, Vertex d) { - // Note : si les deux lignes sont parallèles, on risque fort - // d'avoir une division par zéro. - // http://en.wikipedia.org/wiki/Line-line_intersection - float denominator = ((a.x-b.x)*(c.y-d.y) - (a.y-b.y)*(c.x-d.x)); - return Vertex( - ((a.x*b.y-a.y*b.x)*(c.x-d.x) - (a.x-b.x)*(c.x*d.y-c.y*d.x)) / denominator, - ((a.x*b.y-a.y*b.x)*(c.y-d.y) - (a.y-b.y)*(c.x*d.y-c.y*d.x)) / denominator, - 0 - ); -} - Vertex Vertex::projectOn(Vertex v) const { // http://www.developpez.net/forums/d202580/applications/developpement-2d-3d-jeux/contribuez/faq-mat-quat-ajout-calculs-vectoriels/ float scalaire = (this->x)*(v.x) + (this->y)*(v.y) + (this->z)*(v.z); diff --git a/geometry/vertex.hh b/geometry/vertex.hh index 17f9e01..8bc2532 100644 --- a/geometry/vertex.hh +++ b/geometry/vertex.hh @@ -18,7 +18,6 @@ class Vertex { float cosAngle(Vertex v) const; // cosinus de l'angle entre this et v. float angle(Vertex v) const; // Angle entre this et v. static Vertex fromSpherical(float r, float xAngle, float yAngle); - friend Vertex intersection(Vertex a, Vertex b, Vertex c, Vertex d); // Intersection entre (a,b) et (c,d). public : friend std::ostream& operator<<(std::ostream& os, const Vertex& v);