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

Method VFXLeakyFaucet

src/SB/Game/zNPCTypeVillager.cpp:1820–1848  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1818}
1819
1820void zNPCSandyBikini::VFXLeakyFaucet(F32 dt)
1821{
1822 F32 rat_tym;
1823 xVec3 pos_emit;
1824 xVec3 dir_emit;
1825 F32 dist;
1826 static const xVec3 vec_boneOffset = { 0.05f, 0.0f, 0.0f };
1827 rat_tym = NPCC_TmrCycle(&this->tmr_leakCycle, dt, 0.3f);
1828 const xVec3* bone_pos = (const xVec3*)this->BonePos(17);
1829 pos_emit.x = bone_pos->x;
1830 pos_emit.y = bone_pos->y;
1831 pos_emit.z = bone_pos->z;
1832 pos_emit += vec_boneOffset;
1833 xMat3x3RMulVec(&pos_emit, (const xMat3x3*)this->BoneMat(0), &pos_emit);
1834 pos_emit *= this->cfg_npc->scl_model.x;
1835 pos_emit += *(xVec3*)this->BonePos(0);
1836 this->XZVecToPos(&dir_emit, &pos_emit, NULL);
1837 if (xVec3Length2(&dir_emit) > 0.0f)
1838 {
1839 dir_emit.invert();
1840 dist = xVec3Normalize(&dir_emit, &dir_emit);
1841 dir_emit.y += 0.25f;
1842 xVec3Normalize(&dir_emit, &dir_emit);
1843 F32 temp_sin = isin((PI / 4.0f) * rat_tym);
1844 xVec3SMul(&g_parf_aqualeak.vel, &dir_emit, temp_sin * dist);
1845 xVec3Copy(&g_parf_aqualeak.pos, &pos_emit);
1846 xParEmitterEmitCustom(g_pemit_aqualeak, dt, &g_parf_aqualeak);
1847 }
1848}
1849
1850RwRaster* zNPCBalloonBoy::rast_shadBalloon = NULL;
1851

Callers

nothing calls this directly

Calls 10

xVec3Length2Function · 0.85
isinFunction · 0.85
xVec3SMulFunction · 0.85
xVec3CopyFunction · 0.85
BonePosMethod · 0.80
BoneMatMethod · 0.80
NPCC_TmrCycleFunction · 0.70
xMat3x3RMulVecFunction · 0.50
xVec3NormalizeFunction · 0.50
xParEmitterEmitCustomFunction · 0.50

Tested by

no test coverage detected