mbvital
07-05-2012 10:16:02
Hi,
(I post this toppic also in Add-ons Forum - Mogre, but i'm not sure if is the right place)
I’m working with motion sensors, and I have a mesh with skeleton in my application.
I want to reflect my arm movements in a Virtual Human.
So I apply the orientation of the sensors to the bones of the arms.
However, I want to put physics in my mesh (ok, only on the arms at the moment).
At the beginning I applied physics to the mesh like this (code in C# for Mogre and MogreNewt):
But then I realized that wouldn't work very well since this would apply to the complete mesh and I would like to have something more close to each arm segment.
So I tried to create a Cylinder collision object and apply it to each segment, roughly like this:
I thought that this could work but however, I see my physics object at the world origin instead of the correct location within the character's mesh. If I move the character's mesh to another location, the skeleton keeps in the same place, it doesn't move with the mesh.
My question is: does anyone has an idea on how i can apply physics to the bones of the arms?
Or does anyone has an alternative idea on how should I do this?
Thank you!
(I post this toppic also in Add-ons Forum - Mogre, but i'm not sure if is the right place)
I’m working with motion sensors, and I have a mesh with skeleton in my application.
I want to reflect my arm movements in a Virtual Human.
So I apply the orientation of the sensors to the bones of the arms.
However, I want to put physics in my mesh (ok, only on the arms at the moment).
At the beginning I applied physics to the mesh like this (code in C# for Mogre and MogreNewt):
Entity entHV = mSceneMgr.CreateEntity("Ent", "Victoria 4.2 QuickStart.mesh");
ConvexHull entity = new ConvexHull(world, entHV, 1, 1);
Body bodyEnt = new Body(world, entity, true);
bodyEnt.SetPositionOrientation(entHV.Position, entHV.Orientation);
But then I realized that wouldn't work very well since this would apply to the complete mesh and I would like to have something more close to each arm segment.
So I tried to create a Cylinder collision object and apply it to each segment, roughly like this:
Bone upArm = skeleton.GetBone("rShldr");
upArm.SetManuallyControlled(true);
colUpArm = new Cylinder(world, 7, 25, 10);
bd = new Body(world, colUpArm, true);
colUpArm.Dispose();
bd.SetPositionOrientation(upArm.Position, upArm.Orientation);
I thought that this could work but however, I see my physics object at the world origin instead of the correct location within the character's mesh. If I move the character's mesh to another location, the skeleton keeps in the same place, it doesn't move with the mesh.
My question is: does anyone has an idea on how i can apply physics to the bones of the arms?
Or does anyone has an alternative idea on how should I do this?
Thank you!