It seems there is a bug in UDestructibleComponent::LineTraceComponent in this line:
if (ChunkIdx != NxModuleDestructibleConst::INVALID_CHUNK_INDEX && HitTime <= 1.0f)
I’m standing aproximately 0.3m from the destructible and i;m tracing UDestructibleComponent with LineTraceComponent
and if trace succeded the HitTime is greater than 1.f(18.f <=> 30.f). It seems HitTime is distance between start and hit position, not alpha between start position and end position.
If trace failed the ChunkIdx = -1 and HitTime = 0.f
I think the condition should be changed to:
if (ChunkIdx != NxModuleDestructibleConst::INVALID_CHUNK_INDEX)
Take a look on the UDestructibleComponent::SweepComponent too, same condition is there.
If the trace succeeds and returns a HitTime > 1 then it looks like a bug on APEX. I’ll take a look and see if I can repro this. It’s possible the API comments are wrong, in which case your fix seems valid, but I want to double check this as it seems like a mistake.
It turns out in the destruction rayCast PhysX actually expects a non-normalized direction vector which it uses for the distance. The fix is to remove normalization.
I’m going to submit the change later, but for now simply replace this: