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

Function zEntHangable_UpdateFX

src/SB/Game/zEntHangable.cpp:92–140  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

90}
91
92static void zEntHangable_UpdateFX(zEntHangable* ent)
93{
94 // Points of a (wobbly) circle in 3D space.
95 xVec3 offset_rlii0006[8] =
96 {
97 { 0.0, 0.561, 0.613 },
98 { 0.43345639, 0.432, 0.43345639 },
99 { 0.613, 0.543, 0.0 },
100 { 0.43345639, 0.526, -0.43345639 },
101 { 0.0, 0.526, -0.613 },
102 { -0.43345639, 0.505, -0.43345639 },
103 { -0.613, 0.543, 0.0 },
104 { -0.43345639, 0.48, 0.43345639 }
105 };
106
107 xVec3* local_offset;
108 xParEmitterCustomSettings info;
109 zParEmitter* emitter;
110
111 if ((ent->flags & 1) && (ent->asset->modelInfoID == sChandelierHash))
112 {
113 local_offset = &offset_rlii0006[0];
114
115 // Missing unreachable branches here.
116 if (ent->candle_state == 2)
117 {
118 return;
119 }
120
121 info.custom_flags = 0x100;
122
123 if (ent->candle_state == 0)
124 {
125 emitter = sCandleEmitter;
126 }
127 else
128 {
129 emitter = sCandleSmokeEmitter;
130 }
131
132 for (S32 i = 0; i < (S32)(sizeof(offset_rlii0006) / sizeof(xVec3)); i++)
133 {
134 xVec3 mul;
135 xMat3x3RMulVec(&mul, xEntGetFrame(ent), &local_offset[i]);
136 xVec3Add(&info.pos, &mul, xEntGetPos(ent));
137 xParEmitterEmitCustom(emitter, (1.0f / 30.0f), &info);
138 }
139 }
140}
141
142void zEntHangable_Update(zEntHangable* ent, xScene*, F32 dt)
143{

Callers 1

zEntHangable_UpdateFunction · 0.70

Calls 5

xEntGetFrameFunction · 0.85
xVec3AddFunction · 0.85
xEntGetPosFunction · 0.85
xMat3x3RMulVecFunction · 0.50
xParEmitterEmitCustomFunction · 0.50

Tested by

no test coverage detected