the simpliest case - a joint to be destroied
| 23 | } |
| 24 | // the simpliest case - a joint to be destroied |
| 25 | shell_root CPHShellSplitterHolder::SplitJoint(u16 aspl) |
| 26 | { |
| 27 | // create _new physics shell |
| 28 | |
| 29 | CPhysicsShell* new_shell = P_create_Shell(); |
| 30 | CPHShell* new_shell_desc = smart_cast<CPHShell*>(new_shell); |
| 31 | new_shell_desc->mXFORM.set(m_pShell->mXFORM); |
| 32 | new_shell_desc->m_object_in_root.set(m_pShell->m_object_in_root); |
| 33 | SPLITTER_I splitter = m_splitters.begin() + aspl; |
| 34 | u16 start_element = splitter->m_element; |
| 35 | u16 start_joint = splitter->m_joint; |
| 36 | |
| 37 | u16 end_element = m_pShell->joints[start_joint]->JointDestroyInfo()->m_end_element; |
| 38 | u16 end_joint = m_pShell->joints[start_joint]->JointDestroyInfo()->m_end_joint; |
| 39 | |
| 40 | shell_root ret = mk_pair(new_shell, (m_pShell->joints[start_joint])->BoneID()); |
| 41 | |
| 42 | CShellSplitInfo split_inf; |
| 43 | split_inf.m_bone_id = m_pShell->joints[start_joint]->BoneID(); |
| 44 | split_inf.m_start_el_num = start_element; |
| 45 | split_inf.m_end_el_num = end_element; |
| 46 | split_inf.m_start_jt_num = start_joint; |
| 47 | split_inf.m_end_jt_num = end_joint; |
| 48 | |
| 49 | m_splitters.erase(splitter); |
| 50 | PassEndSplitters(split_inf, new_shell_desc, 1, 0); |
| 51 | |
| 52 | InitNewShell(new_shell_desc); |
| 53 | m_pShell->PassEndElements(start_element, end_element, new_shell_desc); |
| 54 | m_pShell->PassEndJoints(start_joint + 1, end_joint, new_shell_desc); |
| 55 | new_shell_desc->set_PhysicsRefObject(0); |
| 56 | new_shell_desc->PureActivate(); |
| 57 | // new_shell_desc->ObjectInRoot().identity(); |
| 58 | m_pShell->DeleteJoint(start_joint); |
| 59 | new_shell->set_ObjectContactCallback(NULL); |
| 60 | new_shell->set_PhysicsRefObject(NULL); |
| 61 | return ret; |
| 62 | } |
| 63 | |
| 64 | void CPHShellSplitterHolder::PassEndSplitters(const CShellSplitInfo& spl_inf, CPHShell* dest, u16 jt_add_shift, u16 el_add_shift) |
| 65 | { |
nothing calls this directly
no test coverage detected