MCPcopy Create free account
hub / github.com/DescentDevelopers/Descent3 / BreakApartModel

Function BreakApartModel

Descent3/fireball.cpp:1030–1041  ·  view source on GitHub ↗

Break apart a polygon model into pieces of debris

Source from the content-addressed store, hash-verified

1028}
1029// Break apart a polygon model into pieces of debris
1030void BreakApartModel(object *obj, float explosion_mag, int death_flags) {
1031 poly_model *pm = GetPolymodelPointer(obj->rtype.pobj_info.model_num);
1032 if (pm->n_models > 1) {
1033 int i;
1034
1035 // Create debris pieces from subobjects
1036 for (i = 1; i < pm->n_models; i++)
1037 CreateSubobjectDebris(obj, i, explosion_mag, death_flags);
1038 // Change size for collision purposes
1039 obj->size = Poly_models[obj->rtype.pobj_info.model_num].submodel[0].rad;
1040 }
1041}
1042// Splinter stuff
1043#define MAX_SPLINTERS_PER_OBJECT 10
1044// Creates individual face particles from the main body of an object

Callers 1

DestroyObjectFunction · 0.85

Calls 2

GetPolymodelPointerFunction · 0.85
CreateSubobjectDebrisFunction · 0.85

Tested by

no test coverage detected