void GUILane::drawMarkings(const GUIVisualizationSettings& s, SUMOReal scale) const { glPushMatrix(); glPushName(0); glTranslated(0, 0, GLO_EDGE); #ifdef HAVE_INTERNAL if (!MSGlobals::gUseMesoSim) #endif setColor(s); // optionally draw inverse markings if (myIndex > 0) { SUMOReal mw = (myHalfLaneWidth + SUMO_const_laneOffset + .01) * scale; int e = (int) getShape().size() - 1; for (int i = 0; i < e; ++i) { glPushMatrix(); glTranslated(getShape()[i].x(), getShape()[i].y(), 0.1); glRotated(myShapeRotations[i], 0, 0, 1); for (SUMOReal t = 0; t < myShapeLengths[i]; t += 6) { glBegin(GL_QUADS); glVertex2d(-mw, -t); glVertex2d(-mw, -t - 3.); glVertex2d(myQuarterLaneWidth * scale, -t - 3.); glVertex2d(myQuarterLaneWidth * scale, -t); glEnd(); } glPopMatrix(); } } // draw white boundings and white markings glColor3d(1, 1, 1); GLHelper::drawBoxLines( getShape(), getShapeRotations(), getShapeLengths(), (getHalfWidth() + SUMO_const_laneOffset) * scale); glPopMatrix(); glPopName(); }
void CSprite::drawCentered(float x, float y) { draw(x - getHalfWidth(), y - getHalfHeight()); }
void CSprite::drawCentered() { draw(_x - getHalfWidth(), _y - getHalfHeight()); }