Question about character control implementation

Post Reply
goruka
Posts: 27
Joined: Wed Nov 07, 2007 12:49 am

Question about character control implementation

Post by goruka »

Hi there!

I have a doubt about how bullet implemented the character control..
Why is it exactly needed to remove it from the physics itself?
I always managed it as a rigid body unable to get angular velocity,
using a pill or ellipsoid shape (well, pill works better) without problems.

It first comes to mind that the inaccuracy of GJK/EPA may be an issue?, but i
don't have enough knowledge to make a point..

Cheers!
mickey
Posts: 107
Joined: Fri Sep 19, 2008 6:08 pm

Re: Question about character control implementation

Post by mickey »

I believe you are looking at the kinematic character controller demo.

The reason are plenty - you wouldn't want your character to bounce on objects if it hits one - so no restitution. You don't want it either to go ahead and keep on sliding on slopes (eg, terrains). Also rigid bodies are affected by force and impulses. You want to directly move/control the characters without applying these physical quantities.

Although there's a dynamic character controller demo too - that uses a rigid body for the character implementation. I think this may be the reason too why they made it obsolete.

Hope that helps!

Cheers,

David
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA
Contact:

Re: Question about character control implementation

Post by Erwin Coumans »

Bullet just provides sample implementation for kinematic and dynamic character controller.

Both ways can lead to a good character controller, so we should update the documentation and not make the dynamic character controller 'obsolete'. It has nothing to do with GJK/EPA, that should be reliable and accurate enough for those purposes.

The kinematic character controller has the benefit of full control under all circumstances, which is a gameplay issue.

Thanks,
Erwin
goruka
Posts: 27
Joined: Wed Nov 07, 2007 12:49 am

Re: Question about character control implementation

Post by goruka »

mickey wrote:I believe you are looking at the kinematic character controller demo.

You wouldn't want your character to bounce on objects if it hits one - so no restitution. You don't want it either to go ahead and keep on sliding on slopes (eg, terrains). Also rigid bodies are affected by force and impulses. You want to directly move/control the characters without applying these physical quantities.
I actually faced all those problems, i agree, but i think they were not very difficult to overcome. I just control the linear velocity
of the object and ignore angular. At each frame, i remove the axis where the gravity is and treat the remaining "horizontal velocity" normally About the restitution, i just treat it as a special case (i predict the impact velocity and reduce it enough so it won't bounce upon collision) . Sliding on ramps is pretty useful i think, mainly seems to affect the character when still... but i just increase the friction on that case (depending on the normal of course) and it stays nicely. I think the main advantage is that interaction with rigid bodies happens naturally. i can push objects depending on my mass, i can get launched depending on velocity, etc.
nadro
Posts: 17
Joined: Tue Jul 03, 2007 10:37 am

Re: Question about character control implementation

Post by nadro »

Yes, I also implemented similar system in my old project but in this implementation You have got tunelling issue, so this isn't good solution because You have to add CCD test for it and prebuild this system for compatible with this test: first stepup etc. Better solution is only kinematic charavter than mid dynamic / kinematic character controller. Your solution will be good in CCD Bullet world.
Post Reply