Removed unused methods

This commit is contained in:
Matthias Schiffer 2010-01-03 20:23:00 +01:00
parent 853d3978c5
commit cc2a07f13d
2 changed files with 0 additions and 30 deletions

View file

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

View file

@ -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);
};
}