Better Character Controller


I’ve had a character controller implemented into my engine for a while now using PhysX, and it works decently well, but I’m looking for a better solution. The biggest issue I have is that the character controller doesn’t support cylinders because their math is hard to work with, and I’ve never really liked the way that capsule character controllers gently slide down a 90º drop-off because their bottom is rounded. I also had some issues with collision between the character controller and dynamic objects, and the behavior was inconstant, sometimes not being able to move the dynamic body and sometimes hitting it like a truck.

I’ve been playing a lot of Natural Selection 2 lately (great game, go buy it if you haven’t) which also uses PhysX. They have some behind the scenes videos where they show the PhysX visualizer where they show their character controller as a cylinder, which I assume was approximated with a convex mesh… Heres a link if anyone is interested:

I played around in the game for a little bit and noticed that for some of the other characters in the game they use shapes other than cylinders. For instance one of the characters in the game is almost rhinoceros like and uses a large, definitely not cylindrical or capsule shape.

I wanted to revisit my implementation of the character controller and try to make it smoother as well as be a cylinder or another shape. I’ve tried using a rigid body with some modifications and setting the velocity every frame, but I had some very noticeable jittering issues when the controller pushed up against a wall. I also tried to use some sweeping of a convex mesh but I was a bit confused by the hit result’s distance and making sure that the shape didn’t penetrate and get stuck. Any ideas on what I can do to improve my controller?