diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2010-01-03 08:19:56 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2010-01-03 08:19:56 +0100 |
commit | c85a39bb0ffabf11752329c73f502ef74ec1ef76 (patch) | |
tree | 412af009b67e3ecefee824f24b4a3a75d040d244 /src/Collision.h | |
parent | f945e21bbd225d9a2beb0f8e623bf5b9a66fc846 (diff) | |
download | zoom++-c85a39bb0ffabf11752329c73f502ef74ec1ef76.tar zoom++-c85a39bb0ffabf11752329c73f502ef74ec1ef76.zip |
Added correct edge collision
Diffstat (limited to 'src/Collision.h')
-rw-r--r-- | src/Collision.h | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/src/Collision.h b/src/Collision.h index 635a7d3..42e5399 100644 --- a/src/Collision.h +++ b/src/Collision.h @@ -27,11 +27,13 @@ namespace Zoom { class Collision { public: static bool test(const Triangle &t, const MathUtil::Ray &ray, float *distance = 0); - static bool test(const Triangle &t, const vmml::vec3f &m, float r, const vmml::vec3f &move); + static bool test(const Triangle &t, const vmml::vec3f &m, float r, const vmml::vec3f &move, float *distance = 0); private: 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 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); }; |