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

Function zEGenerator_Update

src/SB/Game/zEGenerator.cpp:112–151  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

110}
111
112void zEGenerator_Update(zEGenerator* egen, xScene* sc, F32 dt)
113{
114 xEntUpdate(egen, sc, dt);
115 xMat4x3Toworld(&egen->src_pos, (xMat4x3*)egen->model->Mat, &egen->zasset->src_dpos);
116
117 zEnt* ent = (zEnt*)egen->dst;
118
119 if (ent != NULL && ent->baseFlags & 0x20)
120 {
121 if (ent->baseType == eBaseTypeBoulder)
122 {
123 xVec3Copy(&egen->dst_pos, xEntGetCenter(ent));
124 }
125 else
126 {
127 xMat4x3Toworld(&egen->dst_pos, (xMat4x3*)ent->model->Mat, &egen->dst_off);
128 }
129 }
130
131 if (egen->lfx[0] != NULL)
132 {
133 zLightningModifyEndpoints(egen->lfx[0], &egen->src_pos, &egen->dst_pos);
134 }
135
136 if (egen->lfx[1] != NULL)
137 {
138 zLightningModifyEndpoints(egen->lfx[1], &egen->src_pos, &egen->dst_pos);
139 }
140
141 if (egen->tmr > 0.0f)
142 {
143 egen->tmr -= dt;
144
145 if (egen->tmr <= 0.0f)
146 {
147 zEGenerator_TurnOff(egen);
148 zEntEvent((xBase*)egen, eEventOff);
149 }
150 }
151}
152
153void zEGenerator_Render(zEGenerator* egen)
154{

Callers

nothing calls this directly

Calls 7

xEntUpdateFunction · 0.85
xMat4x3ToworldFunction · 0.85
xVec3CopyFunction · 0.85
xEntGetCenterFunction · 0.85
zEGenerator_TurnOffFunction · 0.85
zEntEventFunction · 0.50

Tested by

no test coverage detected