MCPcopy Create free account
hub / github.com/OGSR/OGSR-Engine / ResetCallbacksRecursive

Method ResetCallbacksRecursive

ogsr_engine/xrGame/PHShell.cpp:974–998  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

972void CPHShell::ResetCallbacks(u16 id, VisMask& mask) { ResetCallbacksRecursive(id, u16(-1), mask); }
973
974void CPHShell::ResetCallbacksRecursive(u16 id, u16 element, VisMask& mask)
975{
976 // if(elements.size()==element) return;
977 CBoneInstance& B = m_pKinematics->LL_GetBoneInstance(u16(id));
978 CBoneData& bone_data = m_pKinematics->LL_GetData(u16(id));
979 SJointIKData& joint_data = bone_data.IK_data;
980
981 if (mask.is(id))
982 {
983 if (no_physics_shape(bone_data.shape) || joint_data.type == jtRigid && element != u16(-1))
984 {
985 B.set_callback(bctPhysics, 0, cast_PhysicsElement(elements[element]));
986 }
987 else
988 {
989 element++;
990 R_ASSERT2(element < elements.size(), "Out of elements!!");
991 // if(elements.size()==element) return;
992 B.set_callback(bctPhysics, BonesCallback, cast_PhysicsElement(elements[element]));
993 B.set_callback_overwrite(TRUE);
994 }
995 }
996 for (vecBonesIt it = bone_data.children.begin(); it != bone_data.children.end(); ++it)
997 ResetCallbacksRecursive((*it)->GetSelfID(), element, mask);
998}
999
1000void CPHShell::EnabledCallbacks(BOOL val)
1001{

Callers

nothing calls this directly

Calls 6

no_physics_shapeFunction · 0.85
isMethod · 0.80
set_callbackMethod · 0.80
sizeMethod · 0.45
beginMethod · 0.45
endMethod · 0.45

Tested by

no test coverage detected