fixed up managed plane rendering a bit

git-svn-id: svn://anubis/anaglym/trunk@129 99a6e188-d820-4881-8870-2d33a10e2619
This commit is contained in:
Josh Holtrop 2009-10-27 23:38:23 +00:00
parent 0d15c1a054
commit e5f616b841

View File

@ -699,16 +699,16 @@ void Engine::Object::render()
if (m_args->size() >= 3) valid = true; if (m_args->size() >= 3) valid = true;
break; break;
case OdeWorld::SPHERE: case OdeWorld::SPHERE:
if (m_args->size() == 4) valid = true; if (m_args->size() >= 1) valid = true;
break; break;
case OdeWorld::PLANE: case OdeWorld::PLANE:
if (m_args->size() == 6) valid = true; if (m_args->size() >= 6) valid = true;
break; break;
case OdeWorld::CYLINDER: case OdeWorld::CYLINDER:
if (m_args->size() == 8) valid = true; if (m_args->size() >= 2) valid = true;
break; break;
case OdeWorld::CCYLINDER: case OdeWorld::CCYLINDER:
if (m_args->size() == 8) valid = true; if (m_args->size() >= 2) valid = true;
break; break;
} }
if (!valid) if (!valid)
@ -719,7 +719,6 @@ void Engine::Object::render()
glNewList(m_display_list, GL_COMPILE); glNewList(m_display_list, GL_COMPILE);
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, m_color); glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, m_color);
GLUquadric * quad = gluNewQuadric(); GLUquadric * quad = gluNewQuadric();
/* TODO: finish */
switch (m_geom_type) switch (m_geom_type)
{ {
case OdeWorld::CUBE: { case OdeWorld::CUBE: {
@ -779,10 +778,10 @@ void Engine::Object::render()
float x_o = (*m_args)[0]; float x_o = (*m_args)[0];
float y_o = (*m_args)[1]; float y_o = (*m_args)[1];
float z_o = (*m_args)[2]; float z_o = (*m_args)[2];
glBegin(GL_QUAD_STRIP);
glNormal3fv(rotated_plane_direction); glNormal3fv(rotated_plane_direction);
for (int x = 0; x < num_sections; x++) for (int x = 0; x < num_sections; x++)
{ {
glBegin(GL_QUAD_STRIP);
for (int y = 0; y <= num_sections; y++) for (int y = 0; y <= num_sections; y++)
{ {
float half_span = num_sections * section_size / 2.0; float half_span = num_sections * section_size / 2.0;
@ -796,9 +795,9 @@ void Engine::Object::render()
y_o + rotated_x[1] * x_c + rotated_y[1] * y_c, y_o + rotated_x[1] * x_c + rotated_y[1] * y_c,
z_o + rotated_x[2] * x_c + rotated_y[2] * y_c); z_o + rotated_x[2] * x_c + rotated_y[2] * y_c);
} }
}
glEnd(); glEnd();
} }
}
break; break;
case OdeWorld::CYLINDER: case OdeWorld::CYLINDER:
glPushMatrix(); glPushMatrix();