Repository navigation
Conversation
GetLocalBoundingBoxForSweep returns the sweep as the displacement over maximumT (relative velocity * maximumT). The convex-compound and compound-pair sweep overlap finders then passed that displacement to FindLocalOverlaps along with maximumT again, so the child query ray only reached velocity * maximumT^2. With maximumT < 1, a sweep missed every Compound, BigCompound and Mesh child beyond that point: a sphere swept 0.8 units at a box 0.75 units away hit it alone but missed it as a compound child. CCD sweeps pass the timestep as maximumT, so they only looked velocity * dt^2 ahead. With maximumT > 1 the query looked further than needed. The overlap query now runs to t = 1 over the displacement.
Member
|
oops! thanks for the report! will try to get to this soon. |
This branch has not been deployed
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
BoundingBoxHelpers.GetLocalBoundingBoxForSweepreturnssweepas the displacement over the whole sweep,(velocityA.Linear - velocityB.Linear) * maximumT.ConvexCompoundSweepOverlapFinderandCompoundPairSweepOverlapFinderthen pass that displacement toFindLocalOverlapstogether withmaximumT, andCompound,BigCompoundandMeshall build their query ray fromsweepand run it tomaximumT. So the child query only reachesvelocity * maximumT².With
maximumT < 1, a sweep misses every child beyond that point. A sphere swept 0.8 units at a box 0.75 units away hits it when the box is a plain shape, but misses the same box as a compound child or a mesh. The same displacement split as velocity 0.8 andmaximumT = 1hits. CCD sweeps inNarrowPhasepass the timestep asmaximumT, so they only lookedvelocity * dt²ahead. WithmaximumT > 1the query just looked further than it had to.I ran into it with a character controller sweeping a capsule a short distance against a large compound: sweeps shorter than 1 unit missed children well within their reach.
The fix passes
1as the overlap query's maximum t in both finders, since the sweep is already the full displacement.Minimal repro (a sphere swept 0.8 units at a three-box compound whose near face is 0.75 units away):
Over Box, Compound, BigCompound and Mesh walls, for a sphere and for a compound holding the sphere (through the sweep task, as CCD does), before (29ed466):
The compound holding the sphere also misses the plain box for the first and last rows. After, every case hits at 0.750.
Tested with the standalone repro above against master and with the fix, and with
DemoTests/CompoundSweepTests.cs, which sweeps a sphere and a compound at each wall type withmaximumTof 0.8, 1, 2 and 1/60. Both tests fail on master and pass with the fix. I ran them on Linux againstBepuPhysicsalone, since the Demos content build needs d3dcompiler there.