diff options
author | Matthias Schiffer <matthias@gamezock.de> | 2010-01-05 22:29:21 +0100 |
---|---|---|
committer | Matthias Schiffer <matthias@gamezock.de> | 2010-01-05 22:29:21 +0100 |
commit | 2aa2097b6cffd6ed58e127b0ed4f76d6255ac495 (patch) | |
tree | 72791955e3a611ea6b4c8180dfcd1d858b7ad403 /src/Collision.h | |
parent | 648ce1d4541b8ea7e9c93c99f251f10277053131 (diff) | |
download | zoom++-2aa2097b6cffd6ed58e127b0ed4f76d6255ac495.tar zoom++-2aa2097b6cffd6ed58e127b0ed4f76d6255ac495.zip |
New and improved edge collision handling! Get it while it's hot!
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 ba987b9..2688435 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, float *distance = 0); + static bool test(const Triangle &t, const vmml::vec3f &m, float r, const vmml::vec3f &move, float *distance = 0, vmml::vec3f *normal = 0); private: Collision(); + static vmml::vec3f projectToEdge(const vmml::vec3f& p, const vmml::vec3f& v1, const vmml::vec3f& v2); + 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); }; |