From 84cea1ffd4ae13cd03c8c29db3721495d39f5063 Mon Sep 17 00:00:00 2001 From: Bradley Austin Davis Date: Mon, 21 Sep 2015 14:33:32 -0700 Subject: [PATCH] More CR comments --- .../entities-renderer/src/RenderableZoneEntityItem.cpp | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp b/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp index 90aff03f55..a102c19512 100644 --- a/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp +++ b/libraries/entities-renderer/src/RenderableZoneEntityItem.cpp @@ -19,6 +19,10 @@ #include #include +// Sphere entities should fit inside a cube entity of the same size, so a sphere that has dimensions 1x1x1 +// is a half unit sphere. However, the geometry cache renders a UNIT sphere, so we need to scale down. +static const float SPHERE_ENTITY_SCALE = 0.5f; + EntityItemPointer RenderableZoneEntityItem::factory(const EntityItemID& entityID, const EntityItemProperties& properties) { return std::make_shared(entityID, properties); } @@ -126,7 +130,7 @@ void RenderableZoneEntityItem::render(RenderArgs* args) { auto xfm = getTransformToCenter(); auto deferredLightingEffect = DependencyManager::get(); if (getShapeType() == SHAPE_TYPE_SPHERE) { - xfm.postScale(0.5); + xfm.postScale(SPHERE_ENTITY_SCALE); deferredLightingEffect->renderWireSphereInstance(batch, xfm, DEFAULT_COLOR); } else { deferredLightingEffect->renderWireCubeInstance(batch, xfm, DEFAULT_COLOR);