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

Method Release

ogsr_engine/xrGame/PHCaptureInit.cpp:279–324  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

277}
278
279void CPHCapture::Release()
280{
281 if (b_failed)
282 return;
283 if (e_state == cstReleased)
284 return;
285 if (m_joint)
286 {
287 m_island.RemoveJoint(m_joint);
288
289 dJointDestroy(m_joint);
290 }
291 m_joint = NULL;
292 if (m_ajoint)
293 {
294 m_island.RemoveJoint(m_ajoint);
295 dJointDestroy(m_ajoint);
296 }
297 m_ajoint = NULL;
298 if (m_body)
299 {
300 m_island.RemoveBody(m_body);
301 dBodyDestroy(m_body);
302 }
303 m_body = NULL;
304
305 if (e_state == cstPulling && m_taget_element && !m_taget_object->getDestroy() && m_taget_object->PPhysicsShell() && m_taget_object->PPhysicsShell()->isActive())
306 {
307 m_taget_element->set_DynamicLimits();
308 }
309
310 b_failed = false;
311 b_collide = true;
312 CActor* A = smart_cast<CActor*>(m_character->PhysicsRefObject());
313 if (A)
314 {
315 if (e_state == cstCaptured && !m_taget_object->getDestroy() && m_taget_object->PPhysicsShell() && m_taget_object->PPhysicsShell()->isActive())
316 {
317 Fvector dir = {0, -1, 0};
318 m_taget_object->PPhysicsShell()->applyImpulse(dir, 0.5f * m_taget_object->PPhysicsShell()->getMass());
319 }
320 A->SetWeaponHideState(INV_STATE_BLOCK_ALL, false);
321 //. A->inventory().setSlotsBlocked(false);
322 }
323 e_state = cstReleased;
324}
325
326void CPHCapture::Deactivate()
327{

Callers 5

~D3D11CtxMethod · 0.45
~D3D12QueueCtxMethod · 0.45
RemoveMapLocationMethod · 0.45
ProcessDelayedEventMethod · 0.45
PHReleaseObjectMethod · 0.45

Calls 10

dJointDestroyFunction · 0.85
dBodyDestroyFunction · 0.85
RemoveJointMethod · 0.80
RemoveBodyMethod · 0.80
SetWeaponHideStateMethod · 0.80
isActiveMethod · 0.45
set_DynamicLimitsMethod · 0.45
PhysicsRefObjectMethod · 0.45
applyImpulseMethod · 0.45
getMassMethod · 0.45

Tested by

no test coverage detected