www

Unnamed repository; edit this file 'description' to name the repository.
Log | Files | Refs

commit 15626bfe9098070808ca90160a8df8049f923e9b
parent 876fe13a489df0a9f2e2c488523d778fbd085cf4
Author: Georges Dupéron <jahvascriptmaniac+github@free.fr>
Date:   Wed, 18 Jan 2012 16:57:54 +0100

Suppression d'une fonction 2D qui n'était plus utilisée.

Diffstat:
Mgeometry/vertex.cpp | 13-------------
Mgeometry/vertex.hh | 1-
2 files changed, 0 insertions(+), 14 deletions(-)

diff --git 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 @@ -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);