]> Dogcows Code - chaz/yoink/blobdiff - src/moof/contact.hh
the massive refactoring effort
[chaz/yoink] / src / moof / contact.hh
diff --git a/src/moof/contact.hh b/src/moof/contact.hh
new file mode 100644 (file)
index 0000000..a14718a
--- /dev/null
@@ -0,0 +1,45 @@
+
+/*]  Copyright (c) 2009-2010, Charles McGarvey  [**************************
+**]  All rights reserved.
+*
+* vi:ts=4 sw=4 tw=75
+*
+* Distributable under the terms and conditions of the 2-clause BSD license;
+* see the file COPYING for a complete text of the license.
+*
+**************************************************************************/
+
+#ifndef _MOOF_CONTACT_HH_
+#define _MOOF_CONTACT_HH_
+
+/**
+ * \file contact.hh
+ * Represents a collision between entities.
+ */
+
+#include <moof/math.hh>
+
+
+namespace moof {
+
+
+template <int D = 3>
+struct contact
+{
+       typedef moof::vector< scalar, fixed<D> > vector;
+
+       vector  point;                  // point of contact
+       scalar  distance;               // distance of penetration
+       vector  normal;                 // normal of surface at point of contact
+
+       bool operator < (const contact& rhs)
+       {
+               return distance < rhs.distance;
+       }
+};
+
+
+} // namespace moof
+
+#endif // _MOOF_CONTACT_HH_
+
This page took 0.021699 seconds and 4 git commands to generate.