7 : color(color_pack(1, 0, 0, 0)), displaylist(0), height(0.2), pose(0, 0, 0, 0), radius(0.1)
11 void Puck::Load(
Worldfile *wf,
int section)
13 pose.Load(wf, section,
"pose");
16 radius = wf->
ReadLength(section,
"radius", radius);
17 height = wf->
ReadLength(section,
"height", height);
22 void Puck::Save(
Worldfile *wf,
int section)
24 pose.Save(wf, section,
"pose");
31 void Puck::BuildDisplayList()
34 displaylist = glGenLists(1);
36 glNewList(displaylist, GL_COMPILE);
38 GLUquadricObj *q = gluNewQuadric();
43 glTranslatef(pose.x, pose.y, pose.z);
44 gluCylinder(q, radius, radius, height, 16, 1);
45 glTranslatef(0, 0, height);
46 gluDisk(q, 0, radius, 16, 16);
51 color_unpack(color, &r, &g, &b, &a);
52 glColor3f(r / 2.0, g / 2.0, b / 2.0);
54 gluQuadricDrawStyle(q, GLU_LINE);
55 glTranslatef(pose.x, pose.y, pose.z);
56 gluCylinder(q, radius + 0.001, radius + 0.001, height + 0.001, 16, 1);
69 glCallList(displaylist);
The Stage library uses its own namespace.
double ReadLength(int entity, const char *name, double value)
void WriteLength(int entity, const char *name, double value)