7 color( color_pack( 1,0,0,0) ),
14 void Puck::Load(
Worldfile* wf,
int section )
16 pose.Load( wf, section,
"pose" );
19 radius = wf->
ReadLength( section,
"radius", radius );
20 height = wf->
ReadLength( section,
"height", height );
25 void Puck::Save(
Worldfile* wf,
int section )
27 pose.Save( wf, section,
"pose" );
34 void Puck::BuildDisplayList()
36 if( displaylist == 0 )
37 displaylist = glGenLists(1);
39 glNewList( displaylist, GL_COMPILE );
41 GLUquadricObj *q = gluNewQuadric();
46 glTranslatef( pose.x, pose.y, pose.z );
47 gluCylinder(q, radius, radius, height, 16, 1 );
48 glTranslatef( 0,0, height);
49 gluDisk(q, 0, radius, 16, 16 );
54 color_unpack( color, &r, &g, &b, &a );
55 glColor3f( r/2.0, g/2.0, b/2.0 );
57 gluQuadricDrawStyle( q, GLU_LINE );
58 glTranslatef( pose.x, pose.y, pose.z );
59 gluCylinder(q, radius+0.001, radius+0.001, height+0.001, 16, 1 );
62 gluDeleteQuadric( q );
69 if( displaylist == 0 )
73 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)