Hi! Here's something I've been thinking about.. I've been trying to put togeter a physics engine for a while, and i'd like to give it a try in games, so I was wondering..
How would one simulate a character? I can think how to do a ragdoll, or a vehicle.. but i suppose for a character walking around a world, as they usually do in games, and collide against stuff.. I'll definitely need to simulate it in some way. Simulating how a person walks or runs seems terribly complex to me, so I'm sure there must be some simplified way to simulate this...
I can imagine that the best way to simulate the character shape would be a pill or an ellipsoid , and have some sort of constrait to keep its foot aligned with the gravity vector applied to the object. I was also thinking that since it can't rotate in that axis, i should make it frictionless... Also, I was thinking that changing its direction simply means altering the linear velocity vector to face somewhere.... however I'm not sure if this is the best approach, what do you people think about this?
Also btw, I ported Erin Catto's Box2D Lite to 3D for learning myself.. would it be of use to anyone to learn? I could release it i guess if so.
Character Simulation
-
- Posts: 861
- Joined: Sun Jul 03, 2005 4:06 pm
- Location: Kirkland, WA
Re: Character Simulation
Maybe you ask this on Erin's forum, http://www.Box2D.orgAlso btw, I ported Erin Catto's Box2D Lite to 3D for learning myself.. would it be of use to anyone to learn? I could release it i guess if so.
- Erwin Coumans
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
- Contact:
Re: Character Simulation
Your 3D port of Box2D light might definately be useful for some people. It should also give you a better understanding of Bullet, as Box2D took a very similar approach. Can you attached the zipped version in this topic?
Yes, a character controller usually uses a simple shape, usually on a stick (ray test), popular choices are capsule (Ratchet and Clank), axis aligned bounding box (Quake etc). In most cases, the character controller is not a rigid body at all, but entirely moved by the user. It can still share the same collision detection routines.
For improved quality character controllers, you can use swept collision detection to detect the hit normals in the environment. For Bullet 2.65 I'm planning to add a basic demo showing such approach.
Thanks,
Erwin
Yes, a character controller usually uses a simple shape, usually on a stick (ray test), popular choices are capsule (Ratchet and Clank), axis aligned bounding box (Quake etc). In most cases, the character controller is not a rigid body at all, but entirely moved by the user. It can still share the same collision detection routines.
For improved quality character controllers, you can use swept collision detection to detect the hit normals in the environment. For Bullet 2.65 I'm planning to add a basic demo showing such approach.
Thanks,
Erwin
Re: Character Simulation
I've tried a lot of approaches of creating a character controller using rigid bodies, but it's pretty pointless so far.. i can't deal with the inertia in any useful way.Erwin Coumans wrote:
Yes, a character controller usually uses a simple shape, usually on a stick (ray test), popular choices are capsule (Ratchet and Clank), axis aligned bounding box (Quake etc). In most cases, the character controller is not a rigid body at all, but entirely moved by the user. It can still share the same collision detection routines.
Approaches I tried:
1) Make a rigid body without friction and simply control the linear velocity in a custom way
This woks great for bouncing into objects and walls, but doesn't work for stepping over moving objects.
2) Apply forces to the object to move it like a character.. this works great for evrything except the motion sucks, because you can clearly see the inertia when turning
If i can't find a way using rigid bodies, i'll have to resort to doing a completely separate type of controller ( not a rigid body ), But this is quite some work and not only i losel the advantages of rigid bodies and their constraits, plus applying impulses to other objects seems like a difficult thing.
Any Pointers?
Thanks
Re: Character Simulation
You could try the character controller from PhysX. The CCT's source code should be released in the next version (or maybe it has already been released, I'm not sure).Any Pointers?
- Pierre
-
- Posts: 41
- Joined: Sat Apr 08, 2006 11:20 am
Re: Character Simulation
Check the first paper here... not sure you could make it work for games but you may still find it interesging.
http://www.cs.ubc.ca/~van/papers/index.html
http://www.cs.ubc.ca/~van/papers/index.html
Re: Character Simulation
You could also check out http://www.fun-motion.com, especially this page for some interesting ideas, and a hilarious video.