| 162 | } |
| 163 | |
| 164 | CPhysicsShell* P_build_SimpleShell(CGameObject* obj, float mass, bool not_active_state) |
| 165 | { |
| 166 | CPhysicsShell* pPhysicsShell = P_create_Shell(); |
| 167 | #ifdef DEBUG |
| 168 | pPhysicsShell->dbg_obj = smart_cast<CPhysicsShellHolder*>(obj); |
| 169 | #endif |
| 170 | Fobb obb; |
| 171 | obj->Visual()->getVisData().box.get_CD(obb.m_translate, obb.m_halfsize); |
| 172 | obb.m_rotate.identity(); |
| 173 | CPhysicsElement* E = P_create_Element(); |
| 174 | R_ASSERT(E); |
| 175 | E->add_Box(obb); |
| 176 | pPhysicsShell->add_Element(E); |
| 177 | pPhysicsShell->setMass(mass); |
| 178 | pPhysicsShell->set_PhysicsRefObject(smart_cast<CPhysicsShellHolder*>(obj)); |
| 179 | if (!obj->H_Parent()) |
| 180 | pPhysicsShell->Activate(obj->XFORM(), 0, obj->XFORM(), not_active_state); |
| 181 | return pPhysicsShell; |
| 182 | } |
| 183 | |
| 184 | void ApplySpawnIniToPhysicShell(CInifile* ini, CPhysicsShell* physics_shell, bool fixed) |
| 185 | { |
no test coverage detected