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

Function SpewObjectNeedsEveryFrameUpdate

Descent3/spew.cpp:462–500  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

460}
461
462bool SpewObjectNeedsEveryFrameUpdate(object *obj, int gun_num) {
463 poly_model *pm;
464 vector pnt;
465 vector normal;
466 int mn; // submodel number
467 float normalized_time[MAX_SUBOBJECTS];
468
469 if (!(obj->flags & OF_POLYGON_OBJECT)) {
470 return false;
471 }
472
473 pm = &Poly_models[obj->rtype.pobj_info.model_num];
474
475 if (pm->n_guns == 0) {
476 return false;
477 }
478
479 SetNormalizedTimeObj(obj, normalized_time);
480 SetModelAnglesAndPos(pm, normalized_time);
481
482 if (gun_num < 0 || gun_num >= pm->n_guns) {
483 return false;
484 }
485
486 pnt = pm->gun_slots[gun_num].pnt;
487 normal = pm->gun_slots[gun_num].norm;
488 mn = pm->gun_slots[gun_num].parent;
489
490 // Instance up the tree for this gun
491 while (mn != -1) {
492 if (pm->submodel[mn].flags & (SOF_ROTATE | SOF_TURRET)) {
493 return true;
494 }
495
496 mn = pm->submodel[mn].parent;
497 }
498
499 return false;
500}

Callers 1

SpewCreateFunction · 0.85

Calls 2

SetNormalizedTimeObjFunction · 0.85
SetModelAnglesAndPosFunction · 0.85

Tested by

no test coverage detected