Open korokuchum opened 2 months ago
Hi @korokuchum. Thanks for the report.
This assert means that some precomputed values are incorrect for some of the convexes, potentially leading to missed collisions. There isn't much we can do without either a repro, or at least the vertices used in that example (so that we can cook the convex on our side and check what happens). This would be unrelated to aggregates.
On the other hand, this is the "legacy" contact generation codepath which was known to have defects for convex-vs-convex collisions anyway. So even if we fix that assert, this specific codepath is ultimately unreliable - and it was the main reason for the introduction of the PCM codepath.
I would therefore suggest switching to PCM (PxSceneFlag::eENABLE_PCM) here.
With PCM enabled I have different assert.
PhysXFoundation_64.dll!physx::PxAssert(const char * expr, const char * file, int line, bool & ignore) Line 59 C++ Symbols loaded.
PhysXCommon_64.dll!testEdgeNormal(const physx::Gu::PolygonalData & polyData0, const physx::Gu::PolygonalData & polyData1, const physx::Gu::SupportLocal * map0, const physx::Gu::SupportLocal * map1, const physx::aos::PxMatTransformV & transform0To1, const physx::aos::PxMatTransformV & transform1To0, const __m128 & contactDist, __m128 & minOverlap, __m128 & edgeNormalIn0, physx::Gu::FeatureStatus edgeStatus, physx::Gu::FeatureStatus & status) Line 314 C++ Symbols loaded.
PhysXCommon_64.dll!physx::Gu::generateFullContactManifold(const physx::Gu::PolygonalData & polyData0, const physx::Gu::PolygonalData & polyData1, const physx::Gu::SupportLocal * map0, const physx::Gu::SupportLocal * map1, physx::Gu::PersistentContact * manifoldContacts, unsigned int & numContacts, const __m128 & contactDist, const __m128 & normal, const __m128 & closestA, const __m128 & closestB, float marginA, float marginB, bool doOverlapTest, physx::PxRenderOutput * renderOutput, float toleranceLength) Line 561 C++ Symbols loaded.
PhysXCommon_64.dll!fullContactsGenerationConvexConvex(const physx::Gu::GjkConvex * relativeConvex, const physx::Gu::GjkConvex * localConvex, const physx::aos::PxTransformV & transf0, const physx::aos::PxTransformV & transf1, bool idtScale0, bool idtScale1, physx::Gu::PersistentContact * manifoldContacts, physx::PxContactBuffer & contactBuffer, physx::Gu::PersistentContactManifold & manifold, __m128 & normal, const __m128 & closestA, const __m128 & closestB, const __m128 & contactDist, bool doOverlapTest, physx::PxRenderOutput * renderOutput, float toleranceLength) Line 64 C++ Symbols loaded.
PhysXCommon_64.dll!generateOrProcessContactsConvexConvex(const physx::Gu::GjkConvex * relativeConvex, const physx::Gu::GjkConvex * localConvex, const physx::aos::PxTransformV & transf0, const physx::aos::PxTransformV & transf1, const physx::aos::PxMatTransformV & aToB, physx::Gu::GjkStatus status, physx::Gu::GjkOutput & output, physx::Gu::PersistentContactManifold & manifold, physx::PxContactBuffer & contactBuffer, unsigned int initialContacts, const __m128 minMargin, const __m128 contactDist, bool idtScale0, bool idtScale1, float toleranceLength, physx::PxRenderOutput * renderOutput) Line 128 C++ Symbols loaded.
PhysXCommon_64.dll!convexHullNoScale0(const physx::Gu::ConvexHullV & convexHull0, const physx::Gu::ConvexHullV & convexHull1, const physx::aos::PxTransformV & transf0, const physx::aos::PxTransformV & transf1, const physx::aos::PxMatTransformV & aToB, physx::Gu::GjkOutput & output, physx::Gu::PersistentContactManifold & manifold, physx::PxContactBuffer & contactBuffer, unsigned int initialContacts, const __m128 minMargin, const __m128 contactDist, bool idtScale1, float toleranceLength, physx::PxRenderOutput * renderOutput) Line 154 C++ Symbols loaded.
PhysXCommon_64.dll!physx::Gu::pcmContactConvexConvex(const physx::PxGeometry & shape0, const physx::PxGeometry & shape1, const physx::PxTransformPadded & transform0, const physx::PxTransformPadded & transform1, const physx::Gu::NarrowPhaseParams & params, physx::Gu::Cache & cache, physx::PxContactBuffer & contactBuffer, physx::PxRenderOutput * renderOutput) Line 256 C++ Symbols loaded.
PhysX_64.dll!PxcPCMContactConvexConvex(const physx::PxGeometry & shape0, const physx::PxGeometry & shape1, const physx::PxTransformPadded & transform0, const physx::PxTransformPadded & transform1, const physx::Gu::NarrowPhaseParams & params, physx::Gu::Cache & cache, physx::PxContactBuffer & contactBuffer, physx::PxRenderOutput * renderOutput) Line 82 C++ Symbols loaded.
PhysX_64.dll!discreteNarrowPhase<0>(physx::PxcNpThreadContext & context, const physx::PxcNpWorkUnit & input, physx::Gu::Cache & cache, physx::PxsContactManagerOutput & output, unsigned __int64 contextID) Line 462 C++ Symbols loaded.
PhysX_64.dll!physx::PxcDiscreteNarrowPhasePCM(physx::PxcNpThreadContext & context, const physx::PxcNpWorkUnit & input, physx::Gu::Cache & cache, physx::PxsContactManagerOutput & output, unsigned __int64 contextID) Line 513 C++ Symbols loaded.
PhysX_64.dll!PxsCMDiscreteUpdateTask::processCms<&physx::PxcDiscreteNarrowPhasePCM>(physx::PxcNpThreadContext * threadContext) Line 446 C++ Symbols loaded.
PhysX_64.dll!PxsCMDiscreteUpdateTask::runInternal() Line 510 C++ Symbols loaded.
PhysX_64.dll!physx::Cm::Task::run() Line 66 C++ Symbols loaded.
Here's the problematic mesh: https://drive.google.com/file/d/1CEb4LRIzhDEll5m37AKbLvewLbEML3Lb/view?usp=sharing In this case convex meshes are created from submeshes in attached mesh.
Mesh description flags: physx::PxConvexFlag::eCOMPUTE_CONVEX | physx::PxConvexFlag::eSHIFT_VERTICES
Library and Version
PhysX v5.4.0
Operating System
Windows 11
Steps to Trigger Behavior
Couldn't find any specific steps. Here's how I got this issue: 1) Create aggregate and add a bunch of Rigid Bodies each with single small convex shape (RigidBodies can overlap) 2) Add aggregate to world 3) Wait for a moment and upon one of the collisions you will receive assert.
Scene setup
Broad Phase Type: Any Solver Type: Any Friction Type: Any
Expected Behavior
Simulation runs without asserts
Actual Behavior
Assert during simulation
Call stack