void CPhysicObject::CreateBody(CSE_ALifeObjectPhysic* po) { if(m_pPhysicsShell) return; IKinematics* pKinematics=smart_cast<IKinematics*>(Visual()); switch(m_type) { case epotBox : { m_pPhysicsShell=P_build_SimpleShell(this,m_mass,!po->_flags.test(CSE_ALifeObjectPhysic::flActive)); } break; case epotFixedChain : case epotFreeChain : { m_pPhysicsShell = P_create_Shell(); m_pPhysicsShell->set_Kinematics(pKinematics); AddElement(0,pKinematics->LL_GetBoneRoot()); m_pPhysicsShell->setMass1(m_mass); } break; case epotSkeleton: { //pKinematics->LL_SetBoneRoot(0); CreateSkeleton(po); }break; default : { } break; } m_pPhysicsShell->mXFORM.set(XFORM()); m_pPhysicsShell->SetAirResistance(0.001f, 0.02f); if(pKinematics) { SAllDDOParams disable_params; disable_params.Load(pKinematics->LL_UserData()); m_pPhysicsShell->set_DisableParams(disable_params); } //m_pPhysicsShell->SetAirResistance(0.002f, 0.3f); }
//--------------------------------------------------------------------- void CAI_Crow::CreateSkeleton() { m_pPhysicsShell=P_build_SimpleShell(this,0.3f,false); m_pPhysicsShell->SetMaterial(smart_cast<CKinematics*>(Visual())->LL_GetData(smart_cast<CKinematics*>(Visual())->LL_GetBoneRoot()).game_mtl_idx); }