MCPcopy Create free account
hub / github.com/TombEngine/TombEngine / ExplodeItemNode

Function ExplodeItemNode

TombEngine/Game/effects/debris.cpp:24–48  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

22std::array<DebrisFragment, MAX_DEBRIS> DebrisFragments;
23
24bool ExplodeItemNode(ItemInfo* item, int node, int noXZVel, int bits)
25{
26 if (1 << node & item->MeshBits.ToPackedBits())
27 {
28 int number = bits;
29 if (number == BODY_DO_EXPLOSION)
30 number = -64;
31
32 auto spheres = item->GetSpheres();
33 ShatterItem.yRot = item->Pose.Orientation.y;
34 ShatterItem.bit = 1 << node;
35 ShatterItem.meshIndex = (node < item->Model.MeshIndex.size()) ? item->Model.MeshIndex[node] : item->Model.BaseMesh;
36 ShatterItem.sphere.Center = spheres[node].Center;
37 ShatterItem.color = item->Model.Color;
38 ShatterItem.flags = item->ObjectNumber == ID_CROSSBOW_BOLT ? 0x400 : 0;
39 ShatterImpactData.impactDirection = Vector3(0, -1, 0);
40 ShatterImpactData.impactLocation = ShatterItem.sphere.Center;
41 ShatterObject(&ShatterItem, NULL, number, item->RoomNumber, noXZVel);
42 item->MeshBits &= ~ShatterItem.bit;
43
44 return true;
45 }
46
47 return false;
48}
49
50DebrisFragment* GetFreeDebrisFragment()
51{

Callers 15

ProcessShootSwitchFunction · 0.85
ControlExplosionFunction · 0.85
ControlGuardianFunction · 0.85
DoGuardianDeathFunction · 0.85
ControlGunShipFunction · 0.85
RomanStatueControlFunction · 0.85
HydraControlFunction · 0.85
CrowDoveSwitchControlFunction · 0.85
ControlMineFunction · 0.85
CollideMineFunction · 0.85
ControlHammerFunction · 0.85
HorsemanControlFunction · 0.85

Calls 5

ShatterObjectFunction · 0.85
ToPackedBitsMethod · 0.80
Vector3Function · 0.50
GetSpheresMethod · 0.45
sizeMethod · 0.45

Tested by

no test coverage detected