Page 1 of 1

Trying to attach something to a b3d joint

Posted: Thu Aug 09, 2007 7:57 am
by NoodlePowa
When I try:

Code: Select all

hand->addChild(cube);
It errors me...

Here's what I have:

Code: Select all

IAnimatedMesh* arm = smgr->getMesh("arm.b3d");
IAnimatedMeshSceneNode* arm00 = smgr->addAnimatedMeshSceneNode(arm);
arm00->setPosition(camera->getPosition());
arm00->setScale(vector3df(20, 20, 20));

ISceneNode* cube = smgr->addCubeSceneNode(50);

ISceneNode* arm00_hand = arm00->getB3DJointNode("Hand");
arm00_hand->addChild(cube);

I have a model of a hand with an armature. The armature contains a bone named "Hand" (With a capital 'H').


It errors at the line:

Code: Select all

arm00_hand->addchild(cube);

Posted: Thu Aug 09, 2007 8:16 am
by xDan
Well, that seems like arm00_hand is invalid, i.e. the joint was not found (or "not a b3d file).

Check the joint name is correct?

You could also using IAnimatedMeshB3d getJointCount() and getJointName(s32) to print out a list of available joints.