[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
This commit is contained in:
LaShonda Hopper 2017-09-12 12:26:15 -04:00
parent 8a4ac9ebc4
commit 789b850846
2 changed files with 14 additions and 27 deletions

View file

@ -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: {

View file

@ -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<geometry::Vec>(i);
#if DEBUG_SIMPLE_HULL_POINT_GENERATION
const geometry::Vec &curVert = shapeVerts.get<geometry::Vec>(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 <size_t SIDES>