Yes, I want to use Bullet to execute the movement (and collision detection) of a game character. So far I've used a ball that encapsulates him (then updates his transform from the ball) and I push it around using impulses. But I don't know how to make him actually move similar to human movement, like not to slide so much and what mass to use ? Did anyone tried it or knows the right measures/friction values/anything ?
And since I updated to Bullet 2.42 (from 1.9 I think) there's no more shape properties or material properties, only some functions to set properties for the object. There was linear damping and angular damping (I'm not into physics, just want them to work) and now there's linear velocity and angular velocity but I don't know if those are the status variables of the object or they effect their behavior (as static variables).
So as a second question : What are the main parameters that affect the way an object behaves ?
So far I have mass,intertia (generated from mass, so it's not actually a parameter), and friction.
Creating a Physical object to behave like a human
-
- Posts: 36
- Joined: Fri Aug 25, 2006 1:00 am
- Location: Bucharest
-
- Site Admin
- Posts: 4221
- Joined: Sun Jun 26, 2005 6:43 pm
- Location: California, USA
Re: Creating a Physical object to behave like a human
Normally, character motion/proxy is non-physical, so not like a dynamic rigidbody. That way you can totally control its motion. You can use Bullet collision detection for this, but you need to come up with your own movement function and interaction with rigidbodies.
Similar to a custom solution for vehicles (btRaycastVehicle), there will be a custom solution for characters in Bullet this year (btCharacter).
Hope this helps,
Erwin
Similar to a custom solution for vehicles (btRaycastVehicle), there will be a custom solution for characters in Bullet this year (btCharacter).
There are quite a few parameters, just inspect the btRigidbody headerfile and Bullet documentation (work-in-progress). You can set the angular/linear damping, friction, restitution, mass, inertia and some other parameters.So as a second question : What are the main parameters that affect the way an object behaves ?
So far I have mass,intertia (generated from mass, so it's not actually a parameter), and friction.
Hope this helps,
Erwin
-
- Posts: 36
- Joined: Fri Aug 25, 2006 1:00 am
- Location: Bucharest
Phew, and I thought I had a critical unresoled bug with the upgrade. It seemed that with the default liniar and angular dampings my ball was rolling forever with the impulses I was giving and couldn't stop it
btCharacter , hoping to see that happen, too bad the vehicles took the flight first but anyway, I was thinking to make a ball that could have great acceleration so it can achieve great speeds and stop really quick when not accelerating anymore, like a lot of friction (and a lot of mass too,but that would generate too much inertia), anyway I'll test some more.
The reason why I want my character to be fully loaded with physics is because I want collision, gravity and impacts to be solved through it. Imagine that a character is hit by another character, it's easier to just add an impulse and see the results.
Side question : If I got 2 objects (a ball and a plane) with their different frictions, in calculus, do these add up ? or will just the friction of the ground count when moving the ball ?
btCharacter , hoping to see that happen, too bad the vehicles took the flight first but anyway, I was thinking to make a ball that could have great acceleration so it can achieve great speeds and stop really quick when not accelerating anymore, like a lot of friction (and a lot of mass too,but that would generate too much inertia), anyway I'll test some more.
The reason why I want my character to be fully loaded with physics is because I want collision, gravity and impacts to be solved through it. Imagine that a character is hit by another character, it's easier to just add an impulse and see the results.
Side question : If I got 2 objects (a ball and a plane) with their different frictions, in calculus, do these add up ? or will just the friction of the ground count when moving the ball ?
-
- Posts: 36
- Joined: Fri Aug 25, 2006 1:00 am
- Location: Bucharest
One other weird thing I see is that if put Linear/Angular Damping at 10 or at 100 the object behaves the same, same with Friction, there's a limit on these ?
And I found out that after a long set of impulses (keeping down the arrow keys to move the character), if I impulse the ball with the reverse of the speed (give or take something) he stops pretty quick, quite good results.
And I found out that after a long set of impulses (keeping down the arrow keys to move the character), if I impulse the ball with the reverse of the speed (give or take something) he stops pretty quick, quite good results.
-
- Posts: 4
- Joined: Tue Jan 23, 2007 11:44 pm
A while ago i made a rigid-body character with cylinder and ray collision, it works relative fine. Theres a YouTube video here: http://www.youtube.com/watch?v=EUIKhAmLG3g
Its best to use no friction and manually control the movement bahavior (go/stop) of the body, from collisions - the angular forces can be problematic so try to reset the angular velocity each frame.
Its best to use no friction and manually control the movement bahavior (go/stop) of the body, from collisions - the angular forces can be problematic so try to reset the angular velocity each frame.