From 789b850846f9f3d9f61e3c8df50ff3acf09ccffe Mon Sep 17 00:00:00 2001 From: LaShonda Hopper Date: Tue, 12 Sep 2017 12:26:15 -0400 Subject: [PATCH] [WL21389] Addresses feedback from PR #11336. * Removes todos from ShapeEntityItem::shapeCalculator stub commit. * Removes defined out debugging, as requested, from GeometryCache::computeSimpleHullPointListForShape. * Moves cone handling to its own section for better contextual flow. Changes Committed: modified: libraries/entities/src/ShapeEntityItem.cpp modified: libraries/render-utils/src/GeometryCache.cpp --- libraries/entities/src/ShapeEntityItem.cpp | 20 ++++++++++++------- libraries/render-utils/src/GeometryCache.cpp | 21 +------------------- 2 files changed, 14 insertions(+), 27 deletions(-) diff --git a/libraries/entities/src/ShapeEntityItem.cpp b/libraries/entities/src/ShapeEntityItem.cpp index 655283a601..8d68e0ab00 100644 --- a/libraries/entities/src/ShapeEntityItem.cpp +++ b/libraries/entities/src/ShapeEntityItem.cpp @@ -283,15 +283,23 @@ void ShapeEntityItem::computeShapeInfo(ShapeInfo& info) { } break; - // gons, ones, & angles built via GeometryCache::extrudePolygon - case entity::Shape::Triangle: - case entity::Shape::Hexagon: - case entity::Shape::Octagon: case entity::Shape::Cone: { if (shapeCalculator) { shapeCalculator(this, info); // shapeCalculator only supports convex shapes (e.g. SHAPE_TYPE_HULL) - // TODO: figure out how to support concave shapes + _collisionShapeType = SHAPE_TYPE_SIMPLE_HULL; + } else { + _collisionShapeType = SHAPE_TYPE_ELLIPSOID; + } + } + break; + // gons, ones, & angles built via GeometryCache::extrudePolygon + case entity::Shape::Triangle: + case entity::Shape::Hexagon: + case entity::Shape::Octagon: { + if (shapeCalculator) { + shapeCalculator(this, info); + // shapeCalculator only supports convex shapes (e.g. SHAPE_TYPE_HULL) _collisionShapeType = SHAPE_TYPE_SIMPLE_HULL; } else { _collisionShapeType = SHAPE_TYPE_ELLIPSOID; @@ -306,12 +314,10 @@ void ShapeEntityItem::computeShapeInfo(ShapeInfo& info) { if ( shapeCalculator ) { shapeCalculator(this, info); // shapeCalculator only supports convex shapes (e.g. SHAPE_TYPE_HULL) - // TODO: figure out how to support concave shapes _collisionShapeType = SHAPE_TYPE_SIMPLE_HULL; } else { _collisionShapeType = SHAPE_TYPE_ELLIPSOID; } - } break; case entity::Shape::Torus: { diff --git a/libraries/render-utils/src/GeometryCache.cpp b/libraries/render-utils/src/GeometryCache.cpp index 004f33cd1c..8164a54a57 100644 --- a/libraries/render-utils/src/GeometryCache.cpp +++ b/libraries/render-utils/src/GeometryCache.cpp @@ -108,31 +108,12 @@ void GeometryCache::computeSimpleHullPointListForShape(const ShapeEntityItem * c const gpu::BufferView::Size numItems = shapeVerts.getNumElements(); const glm::vec3 halfExtents = shapePtr->getDimensions() * 0.5f; -#if DEBUG_SIMPLE_HULL_POINT_GENERATION - shapePtr->debugDump(); - qCDebug(entities) << "------------------ Begin Vert Info( ComputeShapeInfo )[FlatShapes] -----------------------------"; - qCDebug(entities) << " name:" << shapePtr->getName() << ": has " << numItems << " vert info pairs."; -#endif + outPointList.reserve((int)numItems); for (gpu::BufferView::Index i = 0; i < (gpu::BufferView::Index)numItems; ++i) { const geometry::Vec &curNorm = shapeNorms.get(i); -#if DEBUG_SIMPLE_HULL_POINT_GENERATION - const geometry::Vec &curVert = shapeVerts.get(i); - qCDebug(entities) << " --------------------"; - qCDebug(entities) << " Vert( " << i << " ): " << debugTreeVector(curVert); - qCDebug(entities) << " Norm( " << i << " ): " << debugTreeVector(curNorm); -#endif outPointList.push_back(curNorm * halfExtents); - -#if DEBUG_SIMPLE_HULL_POINT_GENERATION - qCDebug(entities) << " Point( " << i << " ): " << debugTreeVector((curNorm * halfExtents)); -#endif } - -#if DEBUG_SIMPLE_HULL_POINT_GENERATION - qCDebug(entities) << "-------------------- End Vert Info( ComputeShapeInfo ) -----------------------------"; -#endif - } template