Physx Character Controller 's Shape always hover from the ground

Started by
4 comments, last by JohnnyCode 8 years, 5 months ago

I tried to use Physx to impledent a Character Controller(PxController). Physx supports two Controller shapes: Box and Capule.
They are defined by PxControllerDesc.

Even I set the description's contactOffset to a number that is very close to 0.

Both of them showed an unexpected result:

[attachment=29473:box.JPG]
[attachment=29472:Capsule.JPG]

The ground was on the plane whose high was 0.

I wondered if the character was actually hovered from the ground. So I used getFootPosition() to get the foot position. The result is unexpectedly 0. But from the image the result should be a result high than 0.

Why did the physx show that strange result?
And how to solve this problem?

Advertisement

Have you set offset/thickness for the ground object as well?

Have you set offset/thickness for the ground object as well?

No I haven't set anything for it. Just simply created a TriangleMesh for it.


No I haven't set anything for it. Just simply created a TriangleMesh for it.

PhysX have property for every collision object, back in my time it was called "skin width" or something like that, it is simply the additional orthogonal uptake of shape where collision of the object appears ahead, it can be positive or negative or neutral.


No I haven't set anything for it. Just simply created a TriangleMesh for it.

PhysX have property for every collision object, back in my time it was called "skin width" or something like that, it is simply the additional orthogonal uptake of shape where collision of the object appears ahead, it can be positive or negative or neutral.

I had noticed that property and set it into zero for both ground shape and character shape, but it couldn't eliminate that phenomenon! I wonder whether there is something else related to that phenomenon.


I had noticed that property and set it into zero for both ground shape and character shape, but it couldn't eliminate that phenomenon! I wonder whether there is something else related to that phenomenon.

In case you have analyzed all plausible properties, it may be that your capsule is a perfect primitive, while your rendered triangulized capsule shape is aproximating it only visually, Could it be? Also, I would encourage you to drop "character controler" object of physX, and use dynamic object primitive with innertia tensor set to 0,0,0 (it willl always anchor, never rotate) you will have much more correct behaviour (character standing on dynamic objects and etc goodies). This worked for me in much more satisfiable extent, wheather sliding, interacting and so on.

This topic is closed to new replies.

Advertisement