timyman
22-06-2006 10:11:00
I want to make [Game "HITMAN4"] style Ragdoll Dragging.
(dead body dragging with hand.....)
I have make 2 Character, and one is ragdoll and the other's Left Hand's position is the Target.
I have Used addGrobalForce to Left Foot toward Target in my custom force callback, but that result is not i want...
that result is so ........ not exact.
i tried another way that change position in ragdoll's newton body but, that result is effective just only that newton body but other linked (by joints) newton bodys....
Is there any way to link newton body to other moving object or position?
sorry for my bad english... thanks..
(dead body dragging with hand.....)
if(bone->getOgreBone()->getName().find("Bip01_L_Foot")!=std::string::npos)
{
//m_vecDragPos
pDoll->m_vecDragPos = pRobot->m_pGripOwner->m_pMainNode->_getFullTransform()*pRobot->m_pGripOwner->m_pGripBone1->_getDerivedPosition();
Ogre::Quaternion bodorient;
Ogre::Vector3 bodpos;
me->getPositionOrientation( bodpos, bodorient );
Ogre::Quaternion finalorient = (bodorient * bone->getOffsetOrient());
Ogre::Vector3 finalpos = bodpos + (bodorient * bone->getOffsetPos());
// Ogre::Vector3 bodpt = (bodorient * dragPoint) + bodpos;
// apply the spring force!
Ogre::Vector3 inertia;
Ogre::Real mass;
me->getMassMatrix( mass, inertia );
// Ogre::Vector3 dragForce = ((pDoll->m_vecDragPos -finalpos ) * 2360 * 8.0) - me->getVelocity();
Ogre::Vector3 dragForce = ((((pDoll->m_vecDragPos -finalpos )*10)- me->getVelocity()) * 2360);
if (pDoll->mDragLine)
{
// line exists, remove it.
delete pDoll->mDragLine;
pDoll->mDragLine = 0;
}
pDoll->mDragLine = new Line3D();
pDoll->mDragLine->addPoint( pDoll->m_vecDragPos );
pDoll->mDragLine->addPoint( finalpos );
pDoll->mDragLine->drawLines();
pRobot->mSceneMgr->getSceneNode("MainNode")->attachObject( pDoll->mDragLine );
me->addGlobalForce( dragForce, finalpos );
nTest = 1;
}I have make 2 Character, and one is ragdoll and the other's Left Hand's position is the Target.
I have Used addGrobalForce to Left Foot toward Target in my custom force callback, but that result is not i want...
that result is so ........ not exact.
i tried another way that change position in ragdoll's newton body but, that result is effective just only that newton body but other linked (by joints) newton bodys....
Is there any way to link newton body to other moving object or position?
sorry for my bad english... thanks..