00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00031 #ifndef _collisionstructures_h_
00032 #define _collisionstructures_h_
00033
00034 #include <vector>
00035 #include "matvec3D.h"
00036
00037 class Body;
00038 class transf;
00039 class position;
00040 class vec3;
00041
00046 typedef std::vector<position> Neighborhood;
00047
00057 typedef struct ContactDataS
00058 {
00059 position b1_pos,b2_pos;
00060 vec3 b1_normal, b2_normal;
00061 Neighborhood nghbd1, nghbd2;
00062 double distSq;
00063 ContactDataS(position b1p, position b2p, vec3 b1n, vec3 b2n, double dsq=-1.0) : b1_pos(b1p), b2_pos(b2p),
00064 b1_normal(b1n), b2_normal(b2n), distSq(dsq) {}
00065 ContactDataS() : b1_pos(0,0,0), b2_pos(0,0,0),
00066 b1_normal(0,0,0), b2_normal(0,0,0), distSq(0) {}
00067 } ContactData;
00068
00072 typedef std::vector<ContactData> ContactReport;
00073
00080 typedef struct CollisionDataS
00081 {
00082 Body *first;
00083 Body *second;
00084 ContactReport contacts;
00085 CollisionDataS(Body *b1, Body *b2) : first(b1), second(b2) {}
00086 } CollisionData;
00087
00091 typedef std::vector<CollisionData> CollisionReport;
00092
00093 #endif