MCPcopy Create free account
hub / github.com/BZFlag-Dev/bzflag / drawDebug

Method drawDebug

src/geometry/TextSceneNode.cpp:723–751  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

721
722
723void TextSceneNode::TextRenderNode::drawDebug() {
724 myColor4fv(*colorPtr);
725
726 fvec3 points[5];
727 sceneNode->getPoints(points);
728
729 glPointSize(3.0f);
730 glLineWidth(3.0f);
731
732 glBegin(GL_LINE_LOOP);
733 for (int i = 0; i < 4; i++) {
734 glVertex3fv(points[i]);
735 }
736 glEnd();
737
738 const double period = 0.5;
739 const double now = BzTime::getCurrent().getSeconds();
740 const float phase = (float)(fmod(now, period) / period);
741 const float alpha = 2.0f * fabsf(0.5f - phase);
742 fvec4 color = 1.0f - *colorPtr;
743 color.a = alpha;
744 glColor4fv(color);
745 glBegin(GL_POINTS);
746 glVertex3fv(points[4]);
747 glEnd();
748
749 glLineWidth(1.0f);
750 glPointSize(1.0f);
751}
752
753
754//============================================================================//

Callers

nothing calls this directly

Calls 2

getPointsMethod · 0.80
getSecondsMethod · 0.80

Tested by

no test coverage detected