MCPcopy Create free account
hub / github.com/bfbbdecomp/bfbb / xParEmitterEmit

Function xParEmitterEmit

src/SB/Core/x/xParEmitter.cpp:430–780  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

428}
429
430xPar* xParEmitterEmit(xParEmitter* pe, F32 emit_dt, F32 par_dt)
431{
432 xPar* p;
433 xPar* last_p;
434 xMat4x3* bone_mat;
435 xParSys* ps;
436 xParEmitterPropsAsset* prop;
437 xParEmitterAsset* pea;
438 xVec3 emitPosition;
439 xVec3 bone_vel;
440 xGroup* g;
441 xEnt* attach_ent;
442
443 F32 life;
444 F32 size_birth;
445 F32 size_death;
446
447 S32 i;
448 S32 c;
449 S32 attachGroupTotal;
450 S32 rate_has_elapsed;
451 U32 attachGroupIndex;
452 S32 count;
453 S32 emitAgain;
454 bool marker;
455 S32 group_ptr_chk;
456 U32 temp_maxPar;
457
458 if (pe->parSys == NULL)
459 {
460 p = NULL;
461 }
462 else
463 { // TODO: could probably be less nested
464 p = NULL;
465 pea = pe->tasset;
466 prop = pe->prop;
467 pe->rate_time = pe->rate_time + emit_dt;
468 size_birth = pe->rate_time;
469 if (pe->rate_time == 0.0)
470 {
471 pe->rate_time = 0.0;
472 }
473 while (pe->rate_time > prop->value[0].freq)
474 {
475 pe->rate_time = pe->rate_time - prop->value[0].freq;
476 }
477 size_birth = xParInterpCompute(pe->rate_mode, prop->value, pe->rate_time, 0, 0.0);
478 pe->rate = size_birth;
479 pe->rate_fraction = pe->rate_fraction + ((double)size_birth * emit_dt);
480 pe->rate_fraction_cull = pe->rate_fraction_cull + (F32)((double)size_birth * emit_dt);
481 size_birth = floorf(pe->rate_fraction);
482 rate_has_elapsed = size_birth;
483 if (rate_has_elapsed > 0)
484 {
485 pe->rate_fraction = pe->rate_fraction - rate_has_elapsed;
486 }
487 if (rate_has_elapsed == 0)

Callers 3

xParEmitterEmitCustomFunction · 0.70
xParEmitterUpdateFunction · 0.70
emit_particleMethod · 0.70

Calls 15

floorfFunction · 0.85
xGroupGetCountFunction · 0.85
xrandFunction · 0.85
xGroupGetItemPtrFunction · 0.85
xGroupGetItemFunction · 0.85
xEntValidTypeFunction · 0.85
xEntGetPosFunction · 0.85
xEntIsVisibleFunction · 0.85
xParEmitterEmitPointFunction · 0.85
xParEmitterEmitRectFunction · 0.85

Tested by

no test coverage detected