how to make this character
how to make this character
I would like to create a "ragdoll" with these parts:
head
torso
upper right and left arm
lower right and left arm
upper right and left leg
lower right and left leg
but here's the hard part: I want it to be able to stand up like a real human
I was thinking of using capsules for the body part, but what joints should I use?
head
torso
upper right and left arm
lower right and left arm
upper right and left leg
lower right and left leg
but here's the hard part: I want it to be able to stand up like a real human
I was thinking of using capsules for the body part, but what joints should I use?
Re: how to make this character
Capsules will work for the body parts.
The joints to use depend on what kind of behavior you want. You could connect it together with a bunch of BallSocketJoints, though without further help the character will quickly collapse.
You could apply springy impulses on parts of the body that keep the pieces at the 'desired' position, and it will probably look acceptable.
If you're looking to do a realistic simulation of joints with friction, motors, and that sort of thing, you will need the features coming in v0.11.0. In v0.11.0, the constraint system is getting an overhaul and is quite a bit more powerful.
The joints to use depend on what kind of behavior you want. You could connect it together with a bunch of BallSocketJoints, though without further help the character will quickly collapse.
You could apply springy impulses on parts of the body that keep the pieces at the 'desired' position, and it will probably look acceptable.
If you're looking to do a realistic simulation of joints with friction, motors, and that sort of thing, you will need the features coming in v0.11.0. In v0.11.0, the constraint system is getting an overhaul and is quite a bit more powerful.
Re: how to make this character
ok thanks any ETA om 0.11 ?Norbo wrote:Capsules will work for the body parts.
The joints to use depend on what kind of behavior you want. You could connect it together with a bunch of BallSocketJoints, though without further help the character will quickly collapse.
You could apply springy impulses on parts of the body that keep the pieces at the 'desired' position, and it will probably look acceptable.
If you're looking to do a realistic simulation of joints with friction, motors, and that sort of thing, you will need the features coming in v0.11.0. In v0.11.0, the constraint system is getting an overhaul and is quite a bit more powerful.
Re: how to make this character
I've tried and failed to guess when it's coming out in the past multiple times, so I'll just say "as soon as possible." I think I can safely say that it's not going to be more than a month or two... I hope!
Re: how to make this character
I have the same problem,
i can't do my character stand up when it collide my map!
My character is described like that
But i don't know how to connect it with bunch of BallSocketJoints
Thank you for help .
i can't do my character stand up when it collide my map!
My character is described like that
Code: Select all
List<Entity> oddShape = new List<Entity>();
Box bottom = new Box(new Vector3(0, 0, 0), 0.3f, 1.2f, 1.2f, 1);
Cylinder middle = new Cylinder(new Vector3(0, 0.2f, 0), 0, 0.1f, 1);
Sphere top = new Sphere(new Vector3(0, 0.4f, 0), 0.2f, 1);
oddShape.Add(bottom);
oddShape.Add(middle);
oddShape.Add(top);
WrappedBody body = new WrappedBody(new Vector3(0, 1, -3), oddShape, 100);
space.add(body);
Matrix scaling = Matrix.CreateScale(0.5f);
entModelHero = new EntityModel(body, heroModel, scaling, this);
Components.Add(entModelHero);
Thank you for help .
Re: how to make this character
If you just want to make your character stay upright, you can give it an infinite inertia tensor (or just around certain axes). This is accomplished by setting rows of the localSpaceInertiaTensorInverse to 0. Setting row 1 to zero makes it as if the inertia around the X axis is infinite, row 2 corresponds to Y, and row 3 corresponds to Z.
An example of this can be found in the demos character controller and vehicle. The character's inertia tensor is infinite, while the vehicle has a slightly modified inertia.
Character:
Vehicle:
Constraints and the BallSocketJoint like this thread was talking about is targeted at getting physically simulated ragdoll characters working, where each section of a character's limb is a different object and it flops around like a... rag doll
An example of this can be found in the demos character controller and vehicle. The character's inertia tensor is infinite, while the vehicle has a slightly modified inertia.
Character:
Code: Select all
body.localSpaceInertiaTensorInverse = Toolbox.zeroMatrix;
Code: Select all
//Increase the inertia parallel to the car to prevent rolling a little.
Matrix inertiaTensorInverse = vehicle.body.localSpaceInertiaTensorInverse;
inertiaTensorInverse.M31 *= .5f;
inertiaTensorInverse.M32 *= .5f;
inertiaTensorInverse.M33 *= .5f;
vehicle.body.localSpaceInertiaTensorInverse = inertiaTensorInverse;
-
- Posts: 19
- Joined: Wed Dec 16, 2009 4:36 pm
Re: how to make this character
Along these lines, lets say that I'm interested in fixing a character/model/entity to a specific xyz location, but they can have angularVelocity around a fixed point. (Think foosball or bubble hockey)
I've used the localSpaceInertiaTensorInverse which keeps my model upright, but if it is spinning and whacks another fixed item in my scene, then this model will react and fly all around my scene (remaining upright however). I'd like to be able to fix my model to a specific pivot point (which I will also want to move around using controller input).
I've used the localSpaceInertiaTensorInverse which keeps my model upright, but if it is spinning and whacks another fixed item in my scene, then this model will react and fly all around my scene (remaining upright however). I'd like to be able to fix my model to a specific pivot point (which I will also want to move around using controller input).
Re: how to make this character
You could do it by manually setting velocities, though this will be somewhat non-rigid when done outside of the solver. To deal with that non-rigidity, you could use a constraint (a connection which is a part of the solver).
If your entity can only rotate around the Y axis, one possibility is to vertically connect a simple BallSocketJoint between it and some attached kinematic entity. Since the piece can only rotate around the Y axis, the connected kinematic entity will keep it in place. If you need to move the piece around, you can change the connected kinematic entity's linear velocity and the piece will follow.
A more direct solution would be to make a special motor-like constraint that only operates on a single entity. Constraints that only operate on linear velocity are pretty simple; if I have time later today I'll see if I can whip one up as an example.
If your entity can only rotate around the Y axis, one possibility is to vertically connect a simple BallSocketJoint between it and some attached kinematic entity. Since the piece can only rotate around the Y axis, the connected kinematic entity will keep it in place. If you need to move the piece around, you can change the connected kinematic entity's linear velocity and the piece will follow.
A more direct solution would be to make a special motor-like constraint that only operates on a single entity. Constraints that only operate on linear velocity are pretty simple; if I have time later today I'll see if I can whip one up as an example.
-
- Posts: 19
- Joined: Wed Dec 16, 2009 4:36 pm
Re: how to make this character
This would be really helpful.A more direct solution would be to make a special motor-like constraint that only operates on a single entity. Constraints that only operate on linear velocity are pretty simple; if I have time later today I'll see if I can whip one up as an example.
I tried using 2 BallSocketJoints, but they just weren't rigid enough to pull my CompoundBody model around (which has a large mass of 90,000f units). The red line connecting my Cylinder Entity (the piece I manipulate around to move the attached CompoundBody) is the BallSocketJoint. As I manipulate the Cylinder Entity (with infinite mass), it moves properly, but the red line connecting the CompoundBody will stretch and SLOWLY pull the CompoundBody around.
- Attachments
-
- BallSocketJoint.jpg (67.3 KiB) Viewed 8816 times
Re: how to make this character
I'm working on the sample motor (tracking down a possible bug in v0.10.4 as well).
Are you moving the kinematic entity with velocities, or are you using move/moveTo? The constraints work on a velocity level; if the entity has no velocity, it will only use position correction which may appear significantly 'gooey-er.' This is part of the reason why having a specialized motor to do it is nicer.
By the way, using more normal mass numbers can help maintain numerical precision during simulation (as if they were kilograms in your game perhaps). You probably won't see issues with a mass of 90,000 since it's less sensitive than the general-case collision detection system, but it's a minor point to keep in mind.
Are you moving the kinematic entity with velocities, or are you using move/moveTo? The constraints work on a velocity level; if the entity has no velocity, it will only use position correction which may appear significantly 'gooey-er.' This is part of the reason why having a specialized motor to do it is nicer.
By the way, using more normal mass numbers can help maintain numerical precision during simulation (as if they were kilograms in your game perhaps). You probably won't see issues with a mass of 90,000 since it's less sensitive than the general-case collision detection system, but it's a minor point to keep in mind.
-
- Posts: 19
- Joined: Wed Dec 16, 2009 4:36 pm
Re: how to make this character
I tried using both linearVelocity and centerPosition properties of my Cylinder Entity.
It was better using linearVelocity, but still has quirks.
It was better using linearVelocity, but still has quirks.
Re: how to make this character
Here's the sample SingleBodyLinearMotor. I haven't thoroughly tested it, but it should do what it needs to.
There's a bug in v0.10.4 that will cause a crash if you try to use it when multithreading is enabled, though. I'm going to be uploading v0.10.5 in a few minutes to address this.
There's a bug in v0.10.4 that will cause a crash if you try to use it when multithreading is enabled, though. I'm going to be uploading v0.10.5 in a few minutes to address this.
- Attachments
-
- SingleBodyLinearMotor.zip
- (2.58 KiB) Downloaded 245 times
Re: how to make this character
v0.10.5's ready now: http://www.bepu-games.com/BEPUphysics/downloads.htm
-
- Posts: 19
- Joined: Wed Dec 16, 2009 4:36 pm
Re: how to make this character
Thanks for this, (and v.0.10.5) I'll try it out later tonight!