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

Function SetNormalizedTimeObj

model/polymodel.cpp:2325–2356  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

2323}
2324
2325void SetNormalizedTimeObj(object *obj, float *normalized_time) {
2326 int i, j;
2327
2328 if (Poly_models[obj->rtype.pobj_info.model_num].flags & PMF_TIMED) {
2329 SetNormalizedTimeObjTimed(obj, normalized_time);
2330 return;
2331 }
2332
2333 float norm_anim_frame = GetNormalizedKeyframe(obj->rtype.pobj_info.model_num, obj->rtype.pobj_info.anim_frame);
2334
2335 // Setup all the subobjects for the keyframe
2336 for (i = 0; i < Poly_models[obj->rtype.pobj_info.model_num].n_models; i++)
2337 normalized_time[i] = norm_anim_frame;
2338
2339 // Currently, we are not handling player weapons in this manner
2340 // chrishack -- weapons with turrets -- COOL.
2341 if (obj->type == OBJ_PLAYER || obj->type == OBJ_WEAPON)
2342 return;
2343
2344 ASSERT(obj->type == OBJ_POWERUP || obj->type == OBJ_ROBOT || obj->type == OBJ_BUILDING || obj->type == OBJ_DEBRIS ||
2345 obj->type == OBJ_DOOR || obj->type == OBJ_CLUTTER);
2346
2347 // Now, override angles of weapon bank turrets
2348 for (i = 0; i < Poly_models[obj->rtype.pobj_info.model_num].num_wbs; i++) {
2349 for (j = 0; j < Poly_models[obj->rtype.pobj_info.model_num].poly_wb[i].num_turrets; j++) {
2350 int sobj_index;
2351
2352 sobj_index = Poly_models[obj->rtype.pobj_info.model_num].poly_wb[i].turret_index[j];
2353 normalized_time[sobj_index] = obj->dynamic_wb[i].norm_turret_angle[j];
2354 }
2355 }
2356}
2357
2358void SetNormalizedTimeAnimTimed(float frame, float *normalized_time, poly_model *pm) {
2359 int i, j;

Callers 9

DoPhysLinkedFrameFunction · 0.85
PhysCalcGroundFunction · 0.85
PolyCollideObjectFunction · 0.85
ApplyLightingToObjectsFunction · 0.85
RenderObjectFunction · 0.85
WeaponCalcGunFunction · 0.85
AttachPointPosFunction · 0.85
VisEffectMoveOneFunction · 0.85

Calls 2

GetNormalizedKeyframeFunction · 0.85

Tested by

no test coverage detected