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

Method Explode

ogsr_engine/xrGame/Explosive.cpp:316–440  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

314 return shoot_factor * dist_factor;
315}
316void CExplosive::Explode()
317{
318 VERIFY(0xffff != Initiator());
319 VERIFY(m_explosion_flags.test(flReadyToExplode)); // m_bReadyToExplode
320 VERIFY(!ph_world->Processing());
321 // m_bExploding = true;
322 m_explosion_flags.set(flExploding, TRUE);
323 cast_game_object()->processing_activate();
324
325 Fvector& pos = m_vExplodePos;
326 Fvector& dir = m_vExplodeDir;
327#ifdef DEBUG
328 if (ph_dbg_draw_mask.test(phDbgDrawExplosions))
329 {
330 DBG_OpenCashedDraw();
331 DBG_DrawPoint(pos, 0.3f, D3DCOLOR_XRGB(255, 0, 0));
332 }
333#endif
334
335 g_pGamePersistent->GrassBendersAddExplosion(cast_game_object()->ID(), pos, {0, -99, 0}, 1.33f, ps_ssfx_int_grass_params_2.y, ps_ssfx_int_grass_params_2.x, m_fBlastRadius * 2.0f);
336
337 // Msg("---------CExplosive Explode [%d] frame[%d]",cast_game_object()->ID(), Device.dwFrame);
338 OnBeforeExplosion();
339 //играем звук взрыва
340 CObject* who = nullptr;
341 if (Initiator() != ALife::_OBJECT_ID(-1))
342 {
343 who = Level().Objects.net_Find(Initiator());
344 }
345 Sound->play_at_pos(sndExplode, who, pos, false);
346
347 //показываем эффекты
348
349 m_wallmark_manager.PlaceWallmarks(pos);
350
351 Fvector vel;
352 smart_cast<CPhysicsShellHolder*>(cast_game_object())->PHGetLinearVell(vel);
353
354 Fmatrix explode_matrix;
355 explode_matrix.identity();
356 explode_matrix.j.set(dir);
357 Fvector::generate_orthonormal_basis(explode_matrix.j, explode_matrix.i, explode_matrix.k);
358 explode_matrix.c.set(pos);
359
360 CParticlesObject* pStaticPG;
361 pStaticPG = CParticlesObject::Create(*m_sExplodeParticles, !m_bDynamicParticles);
362 if (m_bDynamicParticles)
363 m_pExpParticle = pStaticPG;
364 pStaticPG->UpdateParent(explode_matrix, vel);
365 pStaticPG->Play(false);
366
367 //включаем подсветку от взрыва
368 StartLight();
369
370 // trace frags
371 Fvector frag_dir;
372
373 //////////////////////////////

Callers

nothing calls this directly

Calls 15

DBG_OpenCashedDrawFunction · 0.85
DBG_DrawPointFunction · 0.85
CreateFunction · 0.85
DBG_ClosedCashedDrawFunction · 0.85
AddEffectorFunction · 0.85
processing_activateMethod · 0.80
PlaceWallmarksMethod · 0.80
random_dirMethod · 0.80
q_sphereMethod · 0.80
PositionMethod · 0.80

Tested by

no test coverage detected