bool getPCMConvexData(const Gu::GeometryUnion& shape, Cm::FastVertex2ShapeScaling& scaling, PxBounds3& bounds, PolygonalData& polyData) { const PxConvexMeshGeometryLL& shapeConvex = shape.get<const PxConvexMeshGeometryLL>(); const bool idtScale = shapeConvex.scale.isIdentity(); if(!idtScale) scaling.init(shapeConvex.scale); PX_ASSERT(!shapeConvex.hullData->mAABB.isEmpty()); bounds = PxBounds3::transformFast(scaling.getVertex2ShapeSkew(), shapeConvex.hullData->mAABB); getPCMPolygonalData_Convex(&polyData, shapeConvex.hullData, scaling); return idtScale; }
bool Gu::getConvexData(const Gu::GeometryUnion& shape, Cm::FastVertex2ShapeScaling& scaling, PxBounds3& bounds, PolygonalData& polyData) { const PxConvexMeshGeometryLL& shapeConvex = shape.get<const PxConvexMeshGeometryLL>(); const bool idtScale = shapeConvex.scale.isIdentity(); if(!idtScale) scaling.init(shapeConvex.scale); // PT: this version removes all the FCMPs and almost all LHS. This is temporary until // the legacy 3x3 matrix totally vanishes but meanwhile do NOT do useless matrix conversions, // it's a perfect recipe for LHS. PX_ASSERT(!shapeConvex.hullData->mAABB.isEmpty()); bounds = PxBounds3::transformFast(scaling.getVertex2ShapeSkew(), shapeConvex.hullData->mAABB); getPolygonalData_Convex(&polyData, shapeConvex.hullData, scaling); // PT: non-uniform scaling invalidates the "internal objects" optimization, since our internal sphere // might become an ellipsoid or something. Just disable the optimization if scaling is used... if(!idtScale) polyData.mInternal.reset(); return idtScale; }