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

Method Disabling

ogsr_engine/xrGame/PHDisabling.cpp:64–93  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

62 m_stateL2.Reset();
63}
64void CBaseDisableData::Disabling()
65{
66 dBodyID body = get_body();
67 m_count--;
68
69 UpdateL1();
70
71 CheckState(m_stateL1);
72
73 if (m_count == 0) // ph_world->disable_count==dis_frames//m_count==m_frames
74 {
75 UpdateL2();
76 CheckState(m_stateL2);
77 m_count = m_frames;
78 }
79 const dReal* force = dBodyGetForce(body);
80 const dReal* torqu = dBodyGetTorque(body);
81 if (dDOT(force, force) > 0.f || dDOT(torqu, torqu) > 0.f)
82 m_disabled = false;
83 if (dBodyIsEnabled(body))
84 {
85 ReEnable();
86 if (!m_disabled && (ph_world->disable_count != m_count % worldDisablingParams.objects_params.L2frames))
87 {
88 m_count = m_frames + ph_world->disable_count;
89 }
90 }
91 if (m_disabled)
92 Disable(); // dBodyDisable(body);
93}
94
95void CPHDisablingBase::Reinit()
96{

Callers

nothing calls this directly

Calls 3

dBodyGetForceFunction · 0.85
dBodyGetTorqueFunction · 0.85
dBodyIsEnabledFunction · 0.85

Tested by

no test coverage detected