In PhysX 2.8.4 I was able to accomplish the following and I was wondering what might be the best way to do this in 3.2.3.
In order for my character controller to be able to robustly respond to being pushed by a kinematic object I have created a dynamic capsule of the same dimensions as my controller and placed it at the controller location each frame before the physics update. After the update I read back the location of the dynamic object and adjust the position of my controller accordingly. This worked great in PhysX 2.8.4… I could have multiple kinematic actors pushing my character controller in this manner, even arbitrary trimeshes. In 2.8.4 I created this dynamic proxy object with the FREEZE_ROT flags so that the actor would respond by translating only… since the character controller always stays upright. Also I would zero out the linear and angular velocities after each frame.
Now that I’ve upgraded to 3.2.3 I’m trying to find the best way to accomplish this once again. A few things I’ve tried…
Creating the dynamic proxy with a D6 joint to limit the rotation and emulate the FROZEN_ROT flags of 2.8.4 (This somewhat works but sometimes you still see the volume tipping over, and it doesn’t resolve the collision completely each frame anymore… thus zeroing out the linear velocity each frame results in the volume getting pushed in a very jittery manner)
Resolving the penetration in myself outside of the simulation…
This seems to be somewhat promising as it’s not forcing the simulation to do something it’s not really meant to do. I’m using the ::mtd functions for primitives and they seem to work somewhat well.
Does anyone have advice for how I would go about this “properly”? How can I get the simulation to resolve the collisions completely during one update … or alternatively what would be the best way to accomplish this outside the simulation. The way I went about it in 2.8.4 gave really nice results as it only translated the capsule without tipping it over. And also it resulted in a nice sliding feel when the kinematic “pushing” actor was rotating against it. IE it wasn’t acting as if the actor was parented during the collision resolve.
Thanks in advance for any help you can provide,