summaryrefslogtreecommitdiffstats
path: root/src
diff options
context:
space:
mode:
authorMatthias Schiffer <matthias@gamezock.de>2010-01-03 20:23:00 +0100
committerMatthias Schiffer <matthias@gamezock.de>2010-01-03 20:23:00 +0100
commitcc2a07f13d5f6613dabcd454790b088c9c273cbf (patch)
tree55388ccc65c8d7737b3f94cb863ff050958650cd /src
parent853d3978c5d4d1ab47f75fb1e5a11efe354dc79d (diff)
downloadzoom++-cc2a07f13d5f6613dabcd454790b088c9c273cbf.tar
zoom++-cc2a07f13d5f6613dabcd454790b088c9c273cbf.zip
Removed unused methods
Diffstat (limited to 'src')
-rw-r--r--src/Collision.cpp27
-rw-r--r--src/Collision.h3
2 files changed, 0 insertions, 30 deletions
diff --git a/src/Collision.cpp b/src/Collision.cpp
index 91bfc95..ea69b39 100644
--- a/src/Collision.cpp
+++ b/src/Collision.cpp
@@ -23,33 +23,6 @@
namespace Zoom {
-vmml::vec3f Collision::projectToEdge(const vmml::vec3f& p, const vmml::vec3f& v1, const vmml::vec3f& v2) {
- vmml::vec3f pVec = p - v1;
- vmml::vec3f edge = v2 - v1;
-
- float lengthSq = edge.squared_length();
- float edgeProj = vmml::dot(edge, pVec);
-
- if(edgeProj < 0) return v1;
- if(edgeProj > lengthSq) return v2;
-
- return v1 + (edgeProj/lengthSq)*edge;
-}
-
-vmml::vec3f Collision::projectToNearestEdge(const vmml::vec3f& p, const Triangle &t) {
- vmml::vec3f p1 = projectToEdge(p, t.getVertex(0), t.getVertex(1));
- vmml::vec3f p2 = projectToEdge(p, t.getVertex(1), t.getVertex(2));
- vmml::vec3f p3 = projectToEdge(p, t.getVertex(2), t.getVertex(0));
-
- if(p.squared_distance(p1) < p.squared_distance(p2) && p.squared_distance(p1) < p.squared_distance(p3))
- return p1;
- else if(p.squared_distance(p2) < p.squared_distance(p3))
- return p2;
- else
- return p3;
-}
-
-
bool Collision::test(const Triangle &t, const MathUtil::Ray &ray, float *distance) {
vmml::vec3f edge1 = t.getVertex(1) - t.getVertex(0);
vmml::vec3f edge2 = t.getVertex(2) - t.getVertex(0);
diff --git a/src/Collision.h b/src/Collision.h
index df69289..ba987b9 100644
--- a/src/Collision.h
+++ b/src/Collision.h
@@ -34,9 +34,6 @@ class Collision {
static bool testEdge(const vmml::vec3f &v1, const vmml::vec3f &v2, const vmml::vec3f &m, float r, const vmml::vec3f &move, float *distance);
static bool testVertex(const vmml::vec3f &v, const vmml::vec3f &m, float r, const vmml::vec3f &move, float *distance);
-
- static vmml::vec3f projectToEdge(const vmml::vec3f& p, const vmml::vec3f& v1, const vmml::vec3f& v2);
- static vmml::vec3f projectToNearestEdge(const vmml::vec3f& p, const Triangle &t);
};
}