mirror of
https://github.com/overte-org/overte.git
synced 2025-04-20 18:23:54 +02:00
[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:
parent
8a4ac9ebc4
commit
789b850846
2 changed files with 14 additions and 27 deletions
|
@ -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: {
|
||||
|
|
|
@ -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>
|
||||
|
|
Loading…
Reference in a new issue