Skinned Ragdoll Content Processor
Re: Skinned Ragdoll Content Processor
I don't know what it looks like in Maya, but here's what I'm seeing in the demo:
Edit: 'correct' anchor location is approximate. Could be a little off due to the sizes and such.Re: Skinned Ragdoll Content Processor
By the way, there's a constructor of Capsule that takes a start and end position for the internal segment. It may be convenient.
There's an equivalent Capsule.GetCapsuleInformation static method too.
There's an equivalent Capsule.GetCapsuleInformation static method too.
-
- Posts: 20
- Joined: Fri Sep 03, 2010 5:02 pm
- Contact:
Re: Skinned Ragdoll Content Processor
What I think I should be doing, but not entirely clear with though, is positioning the Capsules "position" to the mid-point of the two bones. Is this correct?
If so, then I would suspect something similar to the following:
delta = Vector3.Zero;
delta.X += sk.length / 2.0f;
sk.bone = new Capsule(sk.position + delta, sk.length - 1, sk.radius, mass);
Once I do this the capsules position is at the correct location:
sk.bone.Position {X:2 Y:0 Z:0} Microsoft.Xna.Framework.Vector3
But I need the capsule to be aligned along the X-axis, so I am providing a world transform as mentioned before:
sk.bone.WorldTransform = modelWorld;
Once that transform is set the bone position is changed though:
sk.bone.Position {X:0 Y:0 Z:0} Microsoft.Xna.Framework.Vector3
My thought process is that the joint has to reside safely between the two capsules (upperArm and lowerArm). So the upperArm capsule should extend from (0.5, 0, 0) to (3.5, 0, 0); and the lowerArm capsule should extend from (4, 0.5, 0) to (4, 2.5, 0). That would place the joint at (4, 0, 0).
Yes, No?
If so, then I would suspect something similar to the following:
delta = Vector3.Zero;
delta.X += sk.length / 2.0f;
sk.bone = new Capsule(sk.position + delta, sk.length - 1, sk.radius, mass);
Once I do this the capsules position is at the correct location:
sk.bone.Position {X:2 Y:0 Z:0} Microsoft.Xna.Framework.Vector3
But I need the capsule to be aligned along the X-axis, so I am providing a world transform as mentioned before:
sk.bone.WorldTransform = modelWorld;
Once that transform is set the bone position is changed though:
sk.bone.Position {X:0 Y:0 Z:0} Microsoft.Xna.Framework.Vector3
My thought process is that the joint has to reside safely between the two capsules (upperArm and lowerArm). So the upperArm capsule should extend from (0.5, 0, 0) to (3.5, 0, 0); and the lowerArm capsule should extend from (4, 0.5, 0) to (4, 2.5, 0). That would place the joint at (4, 0, 0).
Yes, No?
-
- Posts: 20
- Joined: Fri Sep 03, 2010 5:02 pm
- Contact:
Re: Skinned Ragdoll Content Processor
Should this be aligned along the X-axis then:
sk.bone = new Capsule( new Vector3(0.0f, 0.0f, 0.0f), new Vector3(4.0f, 0.0f, 0.0f), sk.radius, mass);
It seems like the only way to do so is by using the WorldTransform = Matrix.CreateRotationZ(MathHelper.PiOver2);
sk.bone = new Capsule( new Vector3(0.0f, 0.0f, 0.0f), new Vector3(4.0f, 0.0f, 0.0f), sk.radius, mass);
It seems like the only way to do so is by using the WorldTransform = Matrix.CreateRotationZ(MathHelper.PiOver2);
Re: Skinned Ragdoll Content Processor
Yes, but there's a bug I just fixed a couple of seconds ago- you can grab the new development version here: http://bepuphysics.codeplex.com/SourceC ... evelopmentShould this be aligned along the X-axis then:
sk.bone = new Capsule( new Vector3(0.0f, 0.0f, 0.0f), new Vector3(4.0f, 0.0f, 0.0f), sk.radius, mass);
If it still doesn't seem to be properly oriented, make sure something else isn't transforming it.
Re: Skinned Ragdoll Content Processor
Yes, the position of an entity is at the center of mass of that entity.What I think I should be doing, but not entirely clear with though, is positioning the Capsules "position" to the mid-point of the two bones. Is this correct?
The rest of the transforms can be simplified by the (fixed) segment-capsule construction method.
Basically yes. Though you don't need to worry if the constraint anchor lies within geometry; it's not something that can physically collide. It may look best if the entities do intersect a bit (and have a NoBroadPhase collision rule) so that there's not any gaps. This would mean you could extend the capsule from (0 to 4, 0, 0) and (0, 0 to 3, 0) if you wanted to.My thought process is that the joint has to reside safely between the two capsules (upperArm and lowerArm). So the upperArm capsule should extend from (0.5, 0, 0) to (3.5, 0, 0); and the lowerArm capsule should extend from (4, 0.5, 0) to (4, 2.5, 0). That would place the joint at (4, 0, 0).
Yes, No?
Note that the capsule convenience constructor configures the *internal* segment though, which is then expanded by the radius.
-
- Posts: 20
- Joined: Fri Sep 03, 2010 5:02 pm
- Contact:
Re: Skinned Ragdoll Content Processor
Thank you for your help Norbo.
Now I'm getting a runtime error in the ModelDisplayObjectBatch::Draw method. I rebuilt the solution for the physics DLL's and copied them to the modified Ragdoll example. Am I missing something?
It's erroring out on the worldTransformsParameter.SetValue(worldTransforms) line. Maybe I have the wrong shader?
Now I'm getting a runtime error in the ModelDisplayObjectBatch::Draw method. I rebuilt the solution for the physics DLL's and copied them to the modified Ragdoll example. Am I missing something?
It's erroring out on the worldTransformsParameter.SetValue(worldTransforms) line. Maybe I have the wrong shader?
Re: Skinned Ragdoll Content Processor
Possibly- the InstancedEffect.fx was changed in the latest version; you can copy it over from the other source content into the RagdollDemo content.
-
- Posts: 20
- Joined: Fri Sep 03, 2010 5:02 pm
- Contact:
Re: Skinned Ragdoll Content Processor
That effect file fixed it. I'll perform a few more tests. . .
-
- Posts: 20
- Joined: Fri Sep 03, 2010 5:02 pm
- Contact:
Re: Skinned Ragdoll Content Processor
A lot better now 
So, I should be able to go through all my joints, create the capsules in the same manner as described above, and place the joints right at the intersection points. Correct?
I will switch to different joints, and loosen up the constraints once I get a full body correctly placed in the scene.

So, I should be able to go through all my joints, create the capsules in the same manner as described above, and place the joints right at the intersection points. Correct?
I will switch to different joints, and loosen up the constraints once I get a full body correctly placed in the scene.
Re: Skinned Ragdoll Content Processor
Hopefully, yesSo, I should be able to go through all my joints, create the capsules in the same manner as described above, and place the joints right at the intersection points. Correct?

-
- Posts: 20
- Joined: Fri Sep 03, 2010 5:02 pm
- Contact:
Re: Skinned Ragdoll Content Processor
With any luck I'll post an image later. . . Again, thank you so much for all your help. I hope we can get something up on Creators Club over the summer to demo both our work 

Re: Skinned Ragdoll Content Processor
Hey r2d2Proton,
How did that turn out? Did you end up with the results you were chasing?
Any pretty pics to share?
-Kataan
How did that turn out? Did you end up with the results you were chasing?
Any pretty pics to share?
-Kataan