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

Function SetNormalizedTimeAnim

model/polymodel.cpp:2388–2413  ·  view source on GitHub ↗

This is for non-rotated turrets or rotators

Source from the content-addressed store, hash-verified

2386
2387// This is for non-rotated turrets or rotators
2388void SetNormalizedTimeAnim(float anim_frame, float *normalized_time, poly_model *pm) {
2389 int i, j;
2390
2391 ASSERT(!(pm->flags & PMF_NOT_RESIDENT));
2392
2393 float norm_anim_frame = anim_frame / pm->max_keys;
2394
2395 if (pm->flags & PMF_TIMED) {
2396 SetNormalizedTimeAnimTimed(anim_frame, normalized_time, pm);
2397 return;
2398 }
2399
2400 // Setup all the subobjects for the keyframe
2401 for (i = 0; i < pm->n_models; i++)
2402 normalized_time[i] = norm_anim_frame;
2403
2404 // Now, override angles of weapon bank turrets
2405 for (i = 0; i < pm->num_wbs; i++) {
2406 for (j = 0; j < pm->poly_wb[i].num_turrets; j++) {
2407 int sobj_index;
2408
2409 sobj_index = pm->poly_wb[i].turret_index[j];
2410 normalized_time[sobj_index] = 0.0;
2411 }
2412 }
2413}
2414
2415// Given a model pointer and an array of floats that go from 0..1, calculate the angles of each
2416// corresponding subobject

Callers 6

ComputeDefaultSizeFuncFunction · 0.85
UpdateAnimStateViewMethod · 0.85
UpdateObjectViewMethod · 0.85
RenderCockpitFunction · 0.85
OnDrawMethod · 0.85
TCSSSCallbackFunction · 0.85

Calls 1

Tested by

no test coverage detected