mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
tweak rendering of model entities without valid models to be cubes
This commit is contained in:
parent
9cf6fcdaab
commit
835071ab06
1 changed files with 6 additions and 6 deletions
|
@ -121,11 +121,11 @@ void RenderableModelEntityItem::render(RenderArgs* args) {
|
|||
PerformanceTimer perfTimer("model->render");
|
||||
_model->render(alpha, modelRenderMode);
|
||||
} else {
|
||||
// if we couldn't get a model, then just draw a sphere
|
||||
// if we couldn't get a model, then just draw a cube
|
||||
glColor3ub(getColor()[RED_INDEX],getColor()[GREEN_INDEX],getColor()[BLUE_INDEX]);
|
||||
glPushMatrix();
|
||||
glTranslatef(position.x, position.y, position.z);
|
||||
glutSolidSphere(radius, 15, 15);
|
||||
glutWireCube(size);
|
||||
glPopMatrix();
|
||||
}
|
||||
|
||||
|
@ -175,20 +175,20 @@ void RenderableModelEntityItem::render(RenderArgs* args) {
|
|||
|
||||
}
|
||||
} else {
|
||||
// if we couldn't get a model, then just draw a sphere
|
||||
// if we couldn't get a model, then just draw a cube
|
||||
glColor3ub(getColor()[RED_INDEX],getColor()[GREEN_INDEX],getColor()[BLUE_INDEX]);
|
||||
glPushMatrix();
|
||||
glTranslatef(position.x, position.y, position.z);
|
||||
glutSolidSphere(radius, 15, 15);
|
||||
glutWireCube(size);
|
||||
glPopMatrix();
|
||||
}
|
||||
}
|
||||
glPopMatrix();
|
||||
} else {
|
||||
glColor3f(1.0f, 0.0f, 0.0f);
|
||||
glColor3ub(getColor()[RED_INDEX],getColor()[GREEN_INDEX],getColor()[BLUE_INDEX]);
|
||||
glPushMatrix();
|
||||
glTranslatef(position.x, position.y, position.z);
|
||||
glutSolidSphere(radius, 15, 15);
|
||||
glutWireCube(size);
|
||||
glPopMatrix();
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue