Page 1 of 1

How to attach a weapon into the hand

Posted: Fri Oct 24, 2003 1:21 am
by ttom
Hi folk:
I had two files of ms3d. one is the ninja another is gun. and I want
add the gun into the ninja's "Joint17". when i do this , nothing happen?
//below is code
IAnimatedMesh* meshms3dgun = smgr->getMesh("../media/gun.ms3d");
IAnimatedMeshSceneNode* node_ms3dgun2 = smgr->addAnimatedMeshSceneNode( meshms3dgun );
if(node_ms3dgun2)
{
node_ms3dgun2->setAnimationSpeed(400);
node_ms3dgun2->setPosition(vector3df(-200,-100,-100));
node_ms3dgun2->setScale(vector3df(10,10,10));
node_ms3dgun2->setMaterialFlag(EMF_LIGHTING, false);
//node_ms3d->setFrameLoop(1*40, 14*40);
node_ms3dgun2->setMaterialTexture( 0, driver->getTexture("../media/gun255.bmp") );
}
device->getFileSystem()->addZipFileArchive("../media/ninja.zip");
IAnimatedMesh* meshms3d = smgr->getMesh("ninja.ms3d");
IAnimatedMeshSceneNode* node_ms3d = smgr->addAnimatedMeshSceneNode( meshms3d );
if(node_ms3d)
{
node_ms3d->setAnimationSpeed(400);
node_ms3d->setPosition(vector3df(100,-100,-100));
node_ms3d->setScale(vector3df(30,30,30));
node_ms3d->setMaterialFlag(EMF_LIGHTING, false);
node_ms3d->setFrameLoop(1*40, 14*40);
node_ms3d->setMaterialTexture( 0, driver->getTexture("nskinrd.jpg") );
ISceneNode* hand = node_ms3d->getMS3DJointNode("Joint17");
hand->addChild(node_ms3dgun2);
}
//
sorry for my english

Posted: Fri Oct 24, 2003 8:09 am
by niko
You could let the engine print out all joint names and check if you specified the right name, maybe it helps.

Posted: Tue Oct 28, 2003 1:32 am
by ttom
Sorry I found the error. the gun need the seleton.
thanks niko
keep the good work