コード例 #1
0
ファイル: main.cpp プロジェクト: PrinzEugen7/Robotics
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]);
    }
}
コード例 #2
0
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);
}
コード例 #3
0
ファイル: TrackedVehicle.cpp プロジェクト: fferri/tvs
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();
}
コード例 #4
0
ファイル: SkidSteeringVehicle.cpp プロジェクト: fferri/tvs
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);
        }
    }
}
コード例 #5
0
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);


}