Hi all,
I'm currently trying to modify each joint of a custom rig loaded as a resource in the Horde3D engine.
The idea would be to browse each joint node, retrieves it position & orientation and modify it.
But I also have a constraint, I need to check the joint name before modify it.
Rough Example:
Code:
//...
H3DNode rigNode= h3dAddNodes( H3DRootNode, MyRigResource );
std::string MyCustomJointName="..."
//retrieves all joints
int countNodes=h3dFindNodes( rigNode, "", H3DNodeTypes::Joint);
for(int index=0 ; index<countNodes ; ++index)
{
H3DNode joint=h3dGetNodeFindResult( index );
// find a way to compare the horde3D joint name with my custom joints data
if ( h3dGetNodeParamStr(joint,MyCustomJointName) )
{
float x = h3dGetNodeParamF(joint,H3DGeoRes::GeoVertPosStream,0);
float y = h3dGetNodeParamF(joint,H3DGeoRes::GeoVertPosStream,1);
float z = h3dGetNodeParamF(joint,H3DGeoRes::GeoVertPosStream,2);
h3dSetNodeParamF(joint,H3DGeoRes::GeoVertPosStream,x*2.0);
h3dSetNodeParamF(joint,H3DGeoRes::GeoVertPosStream,y*2.5);
h3dSetNodeParamF(joint,H3DGeoRes::GeoVertPosStream,z*1.5);
}
}
Actually my main problem is that I don't know how to retrieve the position & orientation data from a joint node.
I someone has an idea, it will really be useful.
Thanks