6 static void draw_sphere(const Sphere *sph);
7 static void draw_box(const Box *box);
8 static void draw_plane(const Plane *plane);
10 void draw_geom_object(const GeomObject *gobj)
14 draw_sphere((Sphere*)gobj);
19 Box box = Box(*(AABox*)gobj, Mat4::identity);
29 draw_plane((Plane*)gobj);
37 static void draw_sphere(const Sphere *sph)
40 warning_log("draw_sphere unimplemented\n");
43 static void draw_box(const Box *box)
45 static const int edges[][2] = {
46 {0, 1}, {1, 2}, {2, 3}, {3, 0},
47 {4, 5}, {5, 6}, {6, 7}, {7, 4},
48 {0, 4}, {1, 5}, {2, 6}, {3, 7}
53 glPushAttrib(GL_ENABLE_BIT);
54 glDisable(GL_LIGHTING);
55 glDisable(GL_TEXTURE_2D);
57 glMatrixMode(GL_MODELVIEW);
59 glMultMatrixf(box->xform[0]);
63 for(int i=0; i<12; i++) {
64 Vec3 a = box->get_corner(edges[i][0]);
65 Vec3 b = box->get_corner(edges[i][1]);
67 glVertex3f(a.x, a.y, a.z);
68 glVertex3f(b.x, b.y, b.z);
76 static void draw_plane(const Plane *plane)
79 warning_log("draw_plane unimplemented\n");