majc
01-09-2008 01:29:40
I have this body setup:
im not defining any up vector but it seems the weapon is always up even if i colide with it it returns to the same position (Y axis) why?
And how i setup a body to behave like a human body? By the way the body mass is 80. and gravity (0,-70,0) i tryed 9.8 but it seems i was walking on moon.
Thanks in advance!
Body *cWeaponCollisionHandler::createPhysicalBody(Body *body, SceneNode *node, Ogre::Vector3 position, Quaternion orientation)
{
mBody = body;
Ogre::Vector3 inertia = createInertia(mWeapon->getMass(), Ogre::Vector3(50,50,50));
setMassMatrix(body,mWeapon->getMass(),inertia);
body->setCustomForceAndTorqueCallback <cWeaponCollisionHandler>(&cWeaponCollisionHandler::setCustomForceCallback,this);
setAutoFreeze(body,false);
assignBodyToNode(body,node);
setAngularDamping(body,Ogre::Vector3(0.01f, 0.01f, 0.01f ));
setType(body,WEAPON_TYPE);
setUserData(body,this);
const MaterialID *mMatDefault = createMaterialDefault();
const MaterialID *mMatDefault2 = createMaterialDefault2();
MaterialPair *mMatPairDefault = createMaterialPair(mMatDefault,mMatDefault2);
setDefaultFriction(mMatPairDefault,1,1);
setDefaultSoftness(mMatPairDefault,1);
setDefaultElasticity(mMatPairDefault,0.0);
setContinuousCollisionMode(mMatPairDefault,1);
setMaterialGroupID(body,mMatDefault2);
body->setPositionOrientation(position,orientation);
return body;
}
im not defining any up vector but it seems the weapon is always up even if i colide with it it returns to the same position (Y axis) why?
And how i setup a body to behave like a human body? By the way the body mass is 80. and gravity (0,-70,0) i tryed 9.8 but it seems i was walking on moon.
Thanks in advance!