drow boxes as aabox when we are the simulator

This commit is contained in:
Seth Alves 2015-04-30 13:15:55 -07:00
parent a0ad7a22a6
commit 5d5624053f

View file

@ -35,6 +35,21 @@ void RenderableBoxEntityItem::render(RenderArgs* args) {
glm::vec4 cubeColor(getColor()[RED_INDEX] / MAX_COLOR, getColor()[GREEN_INDEX] / MAX_COLOR,
getColor()[BLUE_INDEX] / MAX_COLOR, getLocalRenderAlpha());
bool highlightSimulationOwnership = false;
if (args->_debugFlags & RenderArgs::RENDER_DEBUG_SIMULATION_OWNERSHIP) {
auto nodeList = DependencyManager::get<NodeList>();
const QUuid& myNodeID = nodeList->getSessionUUID();
highlightSimulationOwnership = (getSimulatorID() == myNodeID);
}
if (highlightSimulationOwnership) {
float size = glm::length(dimensions);
glPushMatrix();
glTranslatef(position.x, position.y, position.z);
DependencyManager::get<DeferredLightingEffect>()->renderWireCube(size, cubeColor);
glPopMatrix();
} else {
glPushMatrix();
glTranslatef(position.x, position.y, position.z);
glm::vec3 axis = glm::axis(rotation);
@ -46,5 +61,5 @@ void RenderableBoxEntityItem::render(RenderArgs* args) {
DependencyManager::get<DeferredLightingEffect>()->renderSolidCube(1.0f, cubeColor);
glPopMatrix();
glPopMatrix();
}
};