#include #include //alex #include #include #include <3D/Point.h> #include <3D/Quaternion.h> #include #define SPACE_SIZE 25 #define NUM_ITER 10000 typedef vector PointList; typedef struct MyObject { int id; } MyObject; /* ARGSUSED */ void collide1(void * client_data, DtObjectRef obj1, DtObjectRef obj2, const DtCollData *coll_data) { } /* ARGSUSED */ void collide2(void * client_data, DtObjectRef obj1, DtObjectRef obj2, const DtCollData *coll_data) { FILE *stream = (FILE *)client_data; fprintf(stream, "Object %d interferes with object %d\n", (*(MyObject *)obj1).id, (*(MyObject *)obj2).id); } int main(int argc, char *argv[]) { MyObject object1, object2; object1.id = 1; object2.id = 2; DtShapeRef shape = dtNewComplexShape(); //////////////////////////////////////////////////////////////////////////////// fprintf(stderr, "Loading the X-wing model composed of 6084 triangles..."); ifstream arg_s("x_wing.vrt"); // Quit if not found. if(!arg_s) { cout << "?????" <> ch; assert(ch == '['); PointList points; //DtVector points[200000]; Point point; do { arg_s>>point[0]>>point[1]>>point[2]>>ch; points.push_back(point); // cout<< points[i][0]<<" "<> ch; assert(ch == '['); do { int index; dtBegin(DT_SIMPLEX); do { arg_s >> index >> ch; if (index >= 0) dtVertexIndex(index); // cout<= 0); // cout<