Rendering of mjGEOM_LINE respects size[0] (width argument of mjv_makeconnector), denominated in pixels.

- Before this change, line width was hardcoded to 3 pixels and the width argument of mjv_makeConnector was ignored.
- After this change, the width argument is respected and interpreted in units of pixel. The non-standard width unit is ok since lines can only be drawn programmatically.

PiperOrigin-RevId: 516529265
Change-Id: I27bffabba69cde415d2ada67263a887c9240efbf
This commit is contained in:
Yuval Tassa
2023-03-14 08:16:56 -07:00
committed by Copybara-Service
parent 972770ba55
commit fe18e58ad2
5 changed files with 5 additions and 4 deletions
+1 -2
View File
@@ -14,7 +14,6 @@
#include "engine/engine_vis_visualize.h"
#include <math.h>
#include <stddef.h>
#include <string.h>
@@ -1591,7 +1590,7 @@ void mjv_addGeoms(const mjModel* m, mjData* d, const mjvOption* vopt,
// make ray
START
mjv_makeConnector(thisgeom, mjGEOM_LINE, .01,
mjv_makeConnector(thisgeom, mjGEOM_LINE, 3,
d->site_xpos[3*sid],
d->site_xpos[3*sid+1],
d->site_xpos[3*sid+2],
+1 -1
View File
@@ -390,7 +390,7 @@ static void renderGeom(const mjvGeom* geom, int mode, const float* headpos,
break;
case mjGEOM_LINE: // line
glLineWidth(3*con->lineWidth);
glLineWidth(size[0]*con->lineWidth);
lighting = glIsEnabled(GL_LIGHTING);
glDisable(GL_LIGHTING);
glBegin(GL_LINES);