[Solved] More ragdoll questions

NoodlesOnMyBack

20-03-2008 17:16:34

Im closer to finally create a ragdoll, i came across with a different problem this time, i want to create a joint between the torso and the arm, but changing the localAnchor value of both actors (i rule at paintbrush):



By default NxOgre set them both to 0,0,0 wich its ok, but now i want to change them to a different location, but if i do this:


sphericalDesc.localAnchor[0].set(NxOgre::toNxVec3(Actor1Pos));
sphericalDesc.localAnchor[1].set(NxOgre::toNxVec3(Actor2Pos));
sphericalDesc.setGlobalAnchor(NxOgre::toNxVec3(pos));
sphericalDesc.setGlobalAxis(NxOgre::toNxVec3(axis));

JointParams jp;
jp.setToDefault();
jp.fromNxJointDesc(sphericalDesc);

mScene->createSphericalJoint(a1,a2,pos,jp);



Nothing happens, both bodies are atached by 0,0,0, and in the AGEIA samples i saw that they atach both actors in the spherical object descriptor , so i added this line:


sphericalDesc.actor[0] = a1->mActor;
sphericalDesc.actor[1] = a2->mActor;


But NxOgre crashed at nxjointdesc.h


NX_INLINE void NxJointDesc::setGlobalAnchor(const NxVec3 & wsAnchor)
{
NxGetUtilLib()->NxJointDesc_SetGlobalAnchor(*this, wsAnchor);
}


So, is there a way to do this just like NxOgre is? or i have to recompile the lib adding some extra params? it would be nice if dont need to do this.

NoodlesOnMyBack

21-03-2008 01:48:28

oops, solution was much easier than i thought, can some of the mods delete this? :roll:

twilight17

21-03-2008 14:39:54

Why not just post the solution, and maybe help some people out :wink:

NoodlesOnMyBack

21-03-2008 18:01:46

Why not just post the solution, and maybe help some people out :wink:

I always post back the solution if i get it first, its just that i had the wrong idea of how spherical joints work, there was no need to modify the localAnchor in this case since i just had to set all actors to bind position and then i set the global anchor, wich is the point where both actors are "jointed", wich means if i move the global anchor position to a different one it just work.
Now the ninja.mesh its beggining to dance :)
When i finish my ragdoll class i will post the entire code, so you just instance the class and you have the ninja ready to roll.

twilight17

21-03-2008 23:31:49

Ok thank you :)