Sfoglia il codice sorgente

InternalEdgeRemovingCollector wasn't copying early out fraction on init

NarrowPhaseQuery::CastRay was updating instead of resetting the early out fraction (this can trigger an assert in case the initial hit fraction > 1)
Jorrit Rouwe 4 mesi fa
parent
commit
bbdece3620

+ 1 - 0
Jolt/Physics/Collision/InternalEdgeRemovingCollector.h

@@ -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

+ 1 - 1
Jolt/Physics/Collision/NarrowPhaseQuery.cpp

@@ -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