void DrawBox() { for(int i = 0; i < BOX_NUM; i++) { dsSetColorAlpha(0.3, 0.2, 0.1, 1.0); dsSetTexture(DS_WOOD); dsDrawBoxD(dBodyGetPosition(box[i].body),dBodyGetRotation(box[i].body), boxSize[i]); } }
void CManipulator::drawBox (dGeomID id, float R, float G, float B) { if (!id) return; const dReal *pos = dGeomGetPosition (id); const dReal *rot = dGeomGetRotation (id); dsSetColor (R,G,B); dVector3 l; dGeomBoxGetLengths (id, l); dsDrawBoxD (pos, rot, l); }
void TrackedVehicle::draw() { { dsSetColor(0, 0, 1); const dReal *pos = dGeomGetPosition(this->vehicleGeom); const dReal *R = dGeomGetRotation(this->vehicleGeom); dReal sides[3]; dGeomBoxGetLengths(this->vehicleGeom, sides); dsDrawBoxD(pos, R, sides); } this->leftTrack->draw(); this->rightTrack->draw(); }
void SkidSteeringVehicle::draw() { { dsSetColor(0, 0, 1); const dReal *pos = dGeomGetPosition(this->vehicleGeom); const dReal *R = dGeomGetRotation(this->vehicleGeom); dReal sides[3]; dGeomBoxGetLengths(this->vehicleGeom, sides); dsDrawBoxD(pos, R, sides); } dsSetColor(1, 1, 0); for(int fr = 0; fr < 2; fr++) { for(int lr = 0; lr < 2; lr++) { const dReal *pos = dGeomGetPosition(this->wheelGeom[fr][lr]); const dReal *R = dGeomGetRotation(this->wheelGeom[fr][lr]); dReal radius, length; dGeomCylinderGetParams(this->wheelGeom[fr][lr], &radius, &length); dsDrawCylinderD(pos, R, length, radius); } } }
void vmWishboneCar::simDraw() { // draw suspension linkages drawLinkage(vm::FR); drawLinkage(vm::FL); drawLinkage(vm::RR); drawLinkage(vm::RL); // draw wheels dsSetColorAlpha(1.0,1.0,0.0,0.5); dsDrawCylinderD(dBodyGetPosition(frWheel.body),dBodyGetRotation(frWheel.body),frWheel.length,frWheel.radius); dsDrawCylinderD(dBodyGetPosition(flWheel.body),dBodyGetRotation(frWheel.body),flWheel.length,flWheel.radius); dsDrawCylinderD(dBodyGetPosition(rrWheel.body),dBodyGetRotation(rrWheel.body),rrWheel.length,rrWheel.radius); dsDrawCylinderD(dBodyGetPosition(rlWheel.body),dBodyGetRotation(rlWheel.body),rlWheel.length,rlWheel.radius); // draw chassis dsSetColorAlpha(1.0,0.0,0.0,0.5); // red dsDrawBoxD(dBodyGetPosition(chassis.body),dBodyGetRotation(chassis.body) ,chassis.sides); }