X-Git-Url: https://git.dogcows.com/gitweb?a=blobdiff_plain;f=src%2Fmoof%2Fcontact.hh;fp=src%2Fmoof%2Fcontact.hh;h=a14718a64117b5bfcf264dc96de92122993c6ef3;hb=831f04d4bc19a390415ac0bbac4331c7a65509bc;hp=0000000000000000000000000000000000000000;hpb=299af4f2047e767e5d79501c26444473bda64c64;p=chaz%2Fyoink diff --git a/src/moof/contact.hh b/src/moof/contact.hh new file mode 100644 index 0000000..a14718a --- /dev/null +++ b/src/moof/contact.hh @@ -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 + + +namespace moof { + + +template +struct contact +{ + typedef moof::vector< scalar, fixed > 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_ +