In our project we have a vehicle that moves at very high speeds. To avoid tunneling issues with certain surfaces, we have enabled CCD on the vehicle.
In the scene we have several dynamic objects configured as 1-Way Interaction, and we have noticed that the collision response is often abnormal (the vehicle frequently loses a significant amount of speed), probably due to the CCD sweep.
To work around this problem, we tried disabling CCD for contacts between the vehicle and these dynamic objects inside the
::OnMidPhaseModification_Internal callback. However, we noticed that the first contact is processed by the Narrow Phase before being added to the MParticleCollisions array in
FCollisionConstraintAllocator::ProcessNewMidPhasesThis is an issue for us, because the first impact can indeed compromise the vehicle’s speed. Do you have any guidance on how to solve this?
Just to double check, when you say configured as 1-way interaction - do you mean the flag where if set to true, this body will treat bodies that do not have the flag set as having infinite mass?
When disabling CCD for contacts were you using FCCDModifier to do so?
I did find this discussion talking about where you can modify contacts but depending on your vehicle setup it may not be the way according to this discussion.
If you have not tried, there’s this tool: Chaos Visual Debugger (CVD)- that you can use to double check snapshot of particle states at different stages to aid in solving this.
As an alternative workaround, if acceptable, you could disable collisions between the two objects and use radial force but it might not look perfect.
Would you be able to provide a small example project / repro and/or a CVD recording?
Yes, with “1-way” I mean that flag. Collisions are correct without CCD, but doesn’t work as expected if CCD is enabled.
Yes, we’re using FCCDModifier - but in that case the problem is still visible at the first step of the contact because the contact is still processed even if disabled.
Sure, I can provide a CVD recording. The problem is reproducible also using the Vehicle Sample in a vanilla version of the engine.
I’m attaching a CVD recording here. I used the VehicleSample, enabled the CCD on the vehicle’s PhysicsAsset, and inserted some objects into the scene flagged as One-Way Interaction.
As you can see in frame 952 of the recording, the collision significantly reduces the vehicle’s speed.
The problem cannot be reproduced systematically with all collisions. It is easier to reproduce if the vehicle collides at very high speed, as shown in the previous recording.
Sounds good, I’ll go ahead and check out a Vehicle Sample and attempt to recreate it while keeping an eye out - thank you!
Edit - I created a Vehicle template project, made an extended runway, ensured the vehicle pawn had ccd enabled on all parts, and placed two huge static mesh cubes (set to Movable) with simulate physics and one way interaction enabled but it didn’t slow down the vehicle, I’ll keep trying things but please let me know if you have any additional repro steps, thank you!
Thank you for the CVD recording, could you please share the example project you made?
I am unable to repro it using VehicleSample, adding a bit of landscape for more runway (on map Lvl_VehicleBasic), enabling the CCD on the vehicle’s PhysicAsset (Specifically PA_SportsCar, on the Root), and adding a scaled cube flagged as One-Way Interaction with simulate physics enabled, I don’t get the interaction from your CVD.
Attached I got this recording where it continues on (interestingly enough sometimes if I extend the cube and it’s wobbling a little bit before impact it does slow the car down).
Nevertheless, once I get your example I’ll go ahead and make a bug report.
Thank you for your patience and all the information you’ve shared.
Thank you for the repro, I was able to reproduce it more consistently in 5.6 and 5.7 by increasing the speed of the vehicle (it looks like Max Torque was decreased to 750 in 5.6 and 5.7 compared to 5.5).
I also added the issue where the first impact compromises the vehicle’s speed.
Thank you for all the information you provided and your patience.
There is no ETA as priorities for bugs and features can shift at any time. We don’t provide updates on EPS, but progress can be followed on that public issue tracker page.
If you have any questions please let me know, otherwise I’ll go ahead and close this case.