Character Controller (Sliding)

KungFooMasta
Posts: 4
Joined: Wed Oct 10, 2007 4:31 pm

Character Controller (Sliding)

Post by KungFooMasta »

Hello all! I've been looking at the various physics/collision libraries available to me, and I'm wondering if there already basic functionality for a character controller in Bullet, or if this is something planned in the near future.

My main requirement is being able to walk over objects, such as terrain, stairs, bridges, platforms, etc. and also to slide along objects. My knowledge is limited when it comes to collision handling, so I would say sliding is a complex subject to me. (If you don't understand what I mean by sliding, I can give more details. Basically if you run into a wall you will hit the wall and then slide along it)

I have found 2 articles describing how to implement sliding, but I think they use swept sphere checks, and I'm not sure if this is a continuous collision detection algorithm or not:

http://p214.ezboard.com/fmrgamemakerfrm ... 3610.topic
http://www.gamedev.net/reference/articl ... le1026.asp

What would be great is to use a capsule shape for characters, and use continuous collision detection to implement sliding and walking over objects. Also, sliding down terrain should not occur. (gravity)

Thanks for any input!
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Character Controller (Sliding)

Post by Erwin Coumans »

KungFooMasta wrote:Hello all! I've been looking at the various physics/collision libraries available to me, and I'm wondering if there already basic functionality for a character controller in Bullet, or if this is something planned in the near future.
[...]
What would be great is to use a capsule shape for characters, and use continuous collision detection to implement sliding and walking over objects. Also, sliding down terrain should not occur. (gravity)

Thanks for any input!
Yes, it is planned to implement a character controller, using Bullet's continuous collision detection query. This means you can choose any convex character proxy shape, like box, sphere, capsule, convex, cone etc.

The btCollisionWorld::objectQuerySingle could be used (work in progress), or directly doing the CCD/swept volume check using one of the btSubSimplexConvexCast (fastest, no rotation, less info), btGjkConvexCast (no rotation, easy to add contact points at the time of impact) or btContinuousConvexCollision (includes rotation).

Would you like to help doing some experiments and give some feedback?
Thanks,
Erwin
KungFooMasta
Posts: 4
Joined: Wed Oct 10, 2007 4:31 pm

Re: Character Controller (Sliding)

Post by KungFooMasta »

I would definately be up for playing around with this, but I'm not at a state where I am able to play with it yet, this was just my initial query to see where the library stands in this regard. :wink:

I'm using Ogre for rendering, so I will have to coordinate with them, I'm not sure the status of the OgreBullet wrapper. (I could integrate it myself, but like everybody, I am limited on time also)

It seems that all collision libraries these days do not focus on a character controller, aside from PhysX. I would think a large majority of people want decent character collision detection and handling..

Like I said I wouldn't mind looking into this, but it will be a while before I have the opportunity. (I'm creating a GUI Library for Ogre users.. not nearly as complex as Bullet or any physics/collision code, but still a lot of work! :) )
User avatar
Erwin Coumans
Site Admin
Posts: 4221
Joined: Sun Jun 26, 2005 6:43 pm
Location: California, USA

Re: Character Controller (Sliding)

Post by Erwin Coumans »

Yeah, various game companies wrote their own character controller on top of Bullet's collision detection. It makes sense to add such character controller demo and/or support into Bullet.

The OgreBullet integration seems to be quite up-to-date, perhaps you can follow up on availability here, and let us know?

http://www.ogre3d.org/phpBB2addons/viewforum.php?f=12

Do you have some link for your GUI library?
Thanks,
Erwin
KungFooMasta
Posts: 4
Joined: Wed Oct 10, 2007 4:31 pm

Re: Character Controller (Sliding)

Post by KungFooMasta »

I PM'ed the maintainer. I'm trying to be somewhat discreet, as I have also made inquiries to the nxOgre (PhysX) maintainer in the Ogre Addons forum. :twisted: I'll play with the library this weekend and see how I like it. :)

I am creator of QuickGUI: http://www.ogre3d.org/phpBB2addons/viewforum.php?f=13

The latest screenshot can be seen on my SVN thread: http://www.ogre3d.org/phpBB2addons/view ... 9&start=15