-
Notifications
You must be signed in to change notification settings - Fork 786
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Inverse Mass Scale Contact Modification and CCD #659
Comments
Hi Phil It seems like an alternative solution to the contact modification. |
I wasn't aware of dominance groups. Thank you for pointing them out as they sound like a good alternative for this case. |
I have tried out dominance groups and they work well for stopping my vehicle losing speed when hitting the road sign. I tried a very simplistic test of putting my vehicle in group 1 and then having group 1 dominate group 0 (the default group) i.e.
This had the desired effect on the sign but also had some rather undesirable effects such as my vehicle falling though the landscape, if it rolled over onto it. I guess this is what would be expected given the vehicle now dominates everything else. Presumably the way to avoid this is to add a group 2 and specifically put things I don't want to affect my vehicle velocity into this group and then have group 1 dominate group 2, rather than group 0? Thanks, Phil |
Yes, sure this dominance group hierarchy should be thought through to avoid undesired effects. |
Thank you that is really helpful. |
Hi there,
I am using PhysX 3.4 with Unreal Engine 4.27.
I am successfully modifying contacts on bodies with CCD enabled. I am having an issue, however, modifying the contact for a particular collision.
I want a particular street sign to behave as if it is very light (1 kg) when a vehicle hits it but otherwise have a realistic sort of mass. I thought I could achieve this with an inverse mass scale and inverse inertia scale during contact modification. Despite modifying these values, however, I still lose a lot of speed (maybe 13mph) when hitting the sign at 100mph with my ~2000kg vehicle.
If I disable CCD then the contact modification of the inverse mass and inertia scale behaves as I would expect and I don't noticeably lose any speed when hitting the sign.
I can't disable CCD to fix the issue as this causes all sorts of other unwanted problems.
Here is some output capturing the problem
[2024.04.10-09.13.11:386][146]LogTemp: LogVehicleForce Post Vehicle Update vel V(X=685.11, Y=-4759.98, Z=21.15) (4809.075) angular V(X=0.00, Y=0.00, Z=0.00) (0.001)
[2024.04.10-09.13.11:387][146]LogTemp: LogVehicleForce modifying contact 0 between Road_Sign_USA_Speed_C_2:StaticMesh and BP_Vehicle_Muscle_1_C_0:AdditionalCollisionVersusVehicles
[2024.04.10-09.13.11:387][146]LogVehicleForce: Verbose: [1147] PLAYER VEHICLE FORCE - CONTACT MODIFICATION - InvMassScale and InvInertiaScale 0.004 applied to BP_Vehicle_Muscle_1_C_0 by ADangerZoneWheeledVehicle::OnContactModify. Vel V(X=685.11, Y=-4759.98, Z=21.15)
[2024.04.10-09.13.11:388][146]LogTemp: LogVehicleForce OnContact WITH Notify between Road_Sign_USA_Speed_C_2:StaticMesh (Sign_Small_Retangular) Vel V(0) and BP_Vehicle_Muscle_1_C_0:AdditionalCollisionVersusVehicles (Musclecar_DD2_CollisionCar2Car) Vel V(X=685.11, Y=-4759.98, Z=21.15).
[2024.04.10-09.13.11:389][146]LogTemp: LogVehicleForce ATFEWheeledVehicle::NotifyHit Start Vel V(X=595.26, Y=-4153.58, Z=0.55)
There is no (noticible) speed loss when the same code is run with CCD disabled on the vehicle rigid body.
In a PVD capture my road sign body looks like this:
In a PVD capture my vehicle body looks like this (this capture was from a test with CCD disabled on the body):
The "boxier" highlighted shape is what is configured to collide with the road sign rigid body:
Any help would be greatly appreciated.
Kind regards,
Phil
The text was updated successfully, but these errors were encountered: