| 6 | #include "../Include/xrRender/Kinematics.h" |
| 7 | |
| 8 | void CPHShellSimpleCreator::CreatePhysicsShell() |
| 9 | { |
| 10 | CPhysicsShellHolder* owner = smart_cast<CPhysicsShellHolder*>(this); |
| 11 | VERIFY(owner); |
| 12 | if (!owner->Visual()) |
| 13 | return; |
| 14 | |
| 15 | IKinematics* pKinematics = smart_cast<IKinematics*>(owner->Visual()); |
| 16 | VERIFY(pKinematics); |
| 17 | |
| 18 | if (owner->PPhysicsShell()) |
| 19 | return; |
| 20 | owner->PPhysicsShell() = P_create_Shell(); |
| 21 | #ifdef DEBUG |
| 22 | owner->PPhysicsShell()->dbg_obj = owner; |
| 23 | #endif |
| 24 | owner->m_pPhysicsShell->build_FromKinematics(pKinematics, 0); |
| 25 | |
| 26 | if (owner->m_pPhysicsShell->get_ElementsNumber() == 0) |
| 27 | { |
| 28 | Msg(" ! Error: world item visual [%s] has no elements!", pKinematics->getDebugName().c_str()); |
| 29 | } |
| 30 | else if (!owner->m_pPhysicsShell->get_ElementByStoreOrder(0)->has_geoms()) |
| 31 | { |
| 32 | Msg(" ! Error: world item visual [%s] has no shape!", pKinematics->getDebugName().c_str()); |
| 33 | } |
| 34 | |
| 35 | owner->PPhysicsShell()->set_PhysicsRefObject(owner); |
| 36 | // m_pPhysicsShell->SmoothElementsInertia(0.3f); |
| 37 | owner->PPhysicsShell()->mXFORM.set(owner->XFORM()); |
| 38 | owner->PPhysicsShell()->SetAirResistance(0.001f, 0.02f); |
| 39 | } |
nothing calls this directly
no test coverage detected