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

Method SetCallbacksRecursive

ogsr_engine/xrGame/PHShell.cpp:1028–1054  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1026}
1027
1028void CPHShell::SetCallbacksRecursive(u16 id, u16 element)
1029{
1030 // if(elements.size()==element) return;
1031 CBoneInstance& B = m_pKinematics->LL_GetBoneInstance(u16(id));
1032 CBoneData& bone_data = m_pKinematics->LL_GetData(u16(id));
1033 SJointIKData& joint_data = bone_data.IK_data;
1034 VisMask mask = m_pKinematics->LL_GetBonesVisible();
1035 if (mask.is(id))
1036 {
1037 if ((no_physics_shape(bone_data.shape) || joint_data.type == jtRigid) && element != u16(-1))
1038 {
1039 B.set_callback(bctPhysics, 0, cast_PhysicsElement(elements[element]));
1040 }
1041 else
1042 {
1043 element_position_in_set_calbacks++;
1044 element = element_position_in_set_calbacks;
1045 R_ASSERT2(element < elements.size(), "Out of elements!!");
1046 // if(elements.size()==element) return;
1047 B.set_callback(bctPhysics, bones_callback, cast_PhysicsElement(elements[element]));
1048 // B.set_callback_overwrite(TRUE);
1049 }
1050 }
1051
1052 for (vecBonesIt it = bone_data.children.begin(); it != bone_data.children.end(); ++it)
1053 SetCallbacksRecursive((*it)->GetSelfID(), element);
1054}
1055
1056void CPHShell::ZeroCallbacks()
1057{

Callers

nothing calls this directly

Calls 7

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

Tested by

no test coverage detected