int mainbak(int argc, char** argv) { object1.id = 1; object2.id = 2; vec3 boxMax1 = vec3(2, 2, 2); vec3 boxMax2 = vec3(1, 1, 1); DtShapeRef shape1 = dtBox(boxMax1.x * 2, boxMax1.y * 2, boxMax1.z * 2); DtShapeRef shape2 = dtBox(boxMax2.x * 2, boxMax2.y * 2, boxMax2.z * 2); boxobj1 = BoundingBox(-boxMax1, boxMax1); boxobj2 = BoundingBox(-boxMax2, boxMax2); dtCreateObject(&object1, shape1); dtCreateObject(&object2, shape2); dtDisableCaching(); dtSetDefaultResponse(collide1, DT_SIMPLE_RESPONSE, stdout); if(NO_DISPLAY) return 0; draw(argc, argv); return 0; }
void SimCarCollideConfig(tCar *car) { tCarElt *carElt; carElt = car->carElt; // The current car shape is a box... car->shape = dtBox(carElt->_dimension_x, carElt->_dimension_y, carElt->_dimension_z); dtCreateObject(car, car->shape); car->collisionAware = 1; }
void SimCarCollideConfig(tCar *car, tTrack *track) { tCarElt *carElt; // Create car collision objects. carElt = car->carElt; // The current car shape is a box... car->shape = dtBox(carElt->_dimension_x, carElt->_dimension_y, carElt->_dimension_z); dtCreateObject(car, car->shape); car->collisionAware = 1; // Create fixed track collision objects (just pit wall for now). // TODO: car body/curbs collision. // TODO: car body/flat wall collision (e.g. for pavement, sidewalk). // TODO: define static objects in XML file/tTrack, collide with them as well. }