]> Dogcows Code - chaz/yoink/blob - src/moof/contact.hh
the massive refactoring effort
[chaz/yoink] / src / moof / contact.hh
1
2 /*] Copyright (c) 2009-2010, Charles McGarvey [**************************
3 **] All rights reserved.
4 *
5 * vi:ts=4 sw=4 tw=75
6 *
7 * Distributable under the terms and conditions of the 2-clause BSD license;
8 * see the file COPYING for a complete text of the license.
9 *
10 **************************************************************************/
11
12 #ifndef _MOOF_CONTACT_HH_
13 #define _MOOF_CONTACT_HH_
14
15 /**
16 * \file contact.hh
17 * Represents a collision between entities.
18 */
19
20 #include <moof/math.hh>
21
22
23 namespace moof {
24
25
26 template <int D = 3>
27 struct contact
28 {
29 typedef moof::vector< scalar, fixed<D> > vector;
30
31 vector point; // point of contact
32 scalar distance; // distance of penetration
33 vector normal; // normal of surface at point of contact
34
35 bool operator < (const contact& rhs)
36 {
37 return distance < rhs.distance;
38 }
39 };
40
41
42 } // namespace moof
43
44 #endif // _MOOF_CONTACT_HH_
45
This page took 0.034372 seconds and 4 git commands to generate.