diff options
| author | Bryan Galdrikian <[email protected]> | 2019-07-15 21:28:41 -0700 |
|---|---|---|
| committer | Bryan Galdrikian <[email protected]> | 2019-07-15 21:28:41 -0700 |
| commit | 9e911235772cb122b44b3a55a3f796072098ce04 (patch) | |
| tree | bd8a0e6199eb35364883dffc2f2f69a2b20078fe /sdk/extensions/authoring/source/NvBlastExtAuthoringBondGeneratorImpl.cpp | |
| parent | Hierarchy optimization bugfixes and improvements (diff) | |
| download | blast-9e911235772cb122b44b3a55a3f796072098ce04.tar.xz blast-9e911235772cb122b44b3a55a3f796072098ce04.zip | |
Padding bounds when determining chunks from islands, allows nearby chunks generated this way to be merged with uniteChunks.v1.1.5_pre3
Fixing bug when removing original chunks in uniteChunks function.
Diffstat (limited to 'sdk/extensions/authoring/source/NvBlastExtAuthoringBondGeneratorImpl.cpp')
| -rwxr-xr-x | sdk/extensions/authoring/source/NvBlastExtAuthoringBondGeneratorImpl.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/sdk/extensions/authoring/source/NvBlastExtAuthoringBondGeneratorImpl.cpp b/sdk/extensions/authoring/source/NvBlastExtAuthoringBondGeneratorImpl.cpp index 318479f..bda11e9 100755 --- a/sdk/extensions/authoring/source/NvBlastExtAuthoringBondGeneratorImpl.cpp +++ b/sdk/extensions/authoring/source/NvBlastExtAuthoringBondGeneratorImpl.cpp @@ -267,7 +267,7 @@ float BlastBondGeneratorImpl::processWithMidplanes(TriangleProcessor* trProcesso const Triangle* mB, uint32_t mbvc, const CollisionHull* hull1,
const CollisionHull* hull2, const std::vector<PxVec3>& hull1p,
const std::vector<PxVec3>& hull2p, PxVec3& normal, PxVec3& centroid,
- float maxSeparation)
+ float maxRelSeparation)
{
PxBounds3 bounds;
PxBounds3 aBounds;
@@ -302,6 +302,7 @@ float BlastBondGeneratorImpl::processWithMidplanes(TriangleProcessor* trProcesso chunk1Centroid *= (1.0f / hull1p.size());
chunk2Centroid *= (1.0f / hull2p.size());
+ const float maxSeparation = maxRelSeparation * std::sqrt(std::max(aBounds.getExtents().magnitudeSquared(), bBounds.getExtents().magnitudeSquared()));
Separation separation;
if (!importerHullsInProximityApexFree(hull1p.size(), hull1p.data(), aBounds, PxTransform(PxIdentity),
@@ -1283,7 +1284,7 @@ int32_t BlastBondGeneratorImpl::buildDescFromInternalFracture(FractureTool* tool BondGenerationConfig cfg;
cfg.bondMode = BondGenerationConfig::AVERAGE;
- cfg.maxSeparation = 0.0f;
+ cfg.maxSeparation = 0.01f;
uint32_t nbListSize =
createFullBondListAveraged(chunkCount, chunkTrianglesOffsets.data(), chunkTriangles.data(), nullptr,
|