Skip to content

Commit

Permalink
InternalEdgeRemovingCollector wasn't copying early out fraction on init
Browse files Browse the repository at this point in the history
NarrowPhaseQuery::CastRay was updating instead of resetting the early out fraction (this can trigger an assert in case the initial hit fraction > 1)
  • Loading branch information
jrouwe committed Mar 8, 2025
1 parent 3f62f22 commit bbdece3
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 1 deletion.
1 change: 1 addition & 0 deletions Jolt/Physics/Collision/InternalEdgeRemovingCollector.h
Original file line number Diff line number Diff line change
Expand Up @@ -77,6 +77,7 @@ class InternalEdgeRemovingCollector : public CollideShapeCollector
public:
/// Constructor, configures a collector to be called with all the results that do not hit internal edges
explicit InternalEdgeRemovingCollector(CollideShapeCollector &inChainedCollector) :
CollideShapeCollector(inChainedCollector),
mChainedCollector(inChainedCollector)
{
// Initialize arrays to full capacity to avoid needless reallocation calls
Expand Down
2 changes: 1 addition & 1 deletion Jolt/Physics/Collision/NarrowPhaseQuery.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ bool NarrowPhaseQuery::CastRay(const RRayCast &inRay, RayCastResult &ioHit, cons
mBodyLockInterface(inBodyLockInterface),
mBodyFilter(inBodyFilter)
{
UpdateEarlyOutFraction(ioHit.mFraction);
ResetEarlyOutFraction(ioHit.mFraction);
}

virtual void AddHit(const ResultType &inResult) override
Expand Down

0 comments on commit bbdece3

Please sign in to comment.