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:
parent
0d15c1a054
commit
e5f616b841
13
Engine.cc
13
Engine.cc
@ -699,16 +699,16 @@ void Engine::Object::render()
|
||||
if (m_args->size() >= 3) valid = true;
|
||||
break;
|
||||
case OdeWorld::SPHERE:
|
||||
if (m_args->size() == 4) valid = true;
|
||||
if (m_args->size() >= 1) valid = true;
|
||||
break;
|
||||
case OdeWorld::PLANE:
|
||||
if (m_args->size() == 6) valid = true;
|
||||
if (m_args->size() >= 6) valid = true;
|
||||
break;
|
||||
case OdeWorld::CYLINDER:
|
||||
if (m_args->size() == 8) valid = true;
|
||||
if (m_args->size() >= 2) valid = true;
|
||||
break;
|
||||
case OdeWorld::CCYLINDER:
|
||||
if (m_args->size() == 8) valid = true;
|
||||
if (m_args->size() >= 2) valid = true;
|
||||
break;
|
||||
}
|
||||
if (!valid)
|
||||
@ -719,7 +719,6 @@ void Engine::Object::render()
|
||||
glNewList(m_display_list, GL_COMPILE);
|
||||
glMaterialfv(GL_FRONT, GL_AMBIENT_AND_DIFFUSE, m_color);
|
||||
GLUquadric * quad = gluNewQuadric();
|
||||
/* TODO: finish */
|
||||
switch (m_geom_type)
|
||||
{
|
||||
case OdeWorld::CUBE: {
|
||||
@ -779,10 +778,10 @@ void Engine::Object::render()
|
||||
float x_o = (*m_args)[0];
|
||||
float y_o = (*m_args)[1];
|
||||
float z_o = (*m_args)[2];
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
glNormal3fv(rotated_plane_direction);
|
||||
for (int x = 0; x < num_sections; x++)
|
||||
{
|
||||
glBegin(GL_QUAD_STRIP);
|
||||
for (int y = 0; y <= num_sections; y++)
|
||||
{
|
||||
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,
|
||||
z_o + rotated_x[2] * x_c + rotated_y[2] * y_c);
|
||||
}
|
||||
}
|
||||
glEnd();
|
||||
}
|
||||
}
|
||||
break;
|
||||
case OdeWorld::CYLINDER:
|
||||
glPushMatrix();
|
||||
|
Loading…
x
Reference in New Issue
Block a user