00001 // ContactInfo.h: interface for the ContactInfo class. 00002 // 00004 00005 #ifndef CONTACTINFO_H 00006 #define CONTACTINFO_H 00007 00008 #include "Vector2.h" 00009 #include <vector> 00010 00011 enum ContactType{ 00012 contactTypeForce, 00013 contactTypeForceParallel, 00014 contactTypeTorque 00015 }; 00016 00017 class PhysicalObject; 00018 00019 class ContactInfo { 00020 public: 00022 ContactInfo(PhysicalObject* object, int sigma); 00023 00027 ContactInfo(PhysicalObject* object, int sigma, const Vector2& p, 00028 const Vector2& n, int iSensor=-1); 00029 00031 ContactInfo(PhysicalObject* object, int sigma, const Vector2& p, 00032 const Vector2& n, int iSensor, int iSensor2); 00033 00034 virtual ~ContactInfo(); 00035 00037 int sigma; 00038 00040 ContactType type; 00041 00042 //For force contacts: 00045 Vector2 p; 00048 Vector2 n; 00050 real pxn; 00051 00052 00055 int iSensor, iSensor2; 00056 00059 PhysicalObject* parentObject; 00060 00062 PhysicalObject* object; 00063 00065 real force; 00066 00068 int alpha; 00069 00070 private: 00071 void setupObject(); 00072 }; 00073 00074 typedef std::vector<ContactInfo*> ContactInfoPVector; 00075 00076 #endif //CONTACTINFO_H
Thyrix homepage Users' guide
(C) Arxia 2004-2005