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

Function zLasso_Update

src/SB/Game/zLasso.cpp:153–287  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

151}
152
153void zLasso_Update(zLasso* lasso, xEnt* ent, F32 dt)
154{
155 xVec3 newPoint;
156 iModelTagEval(ent->model->Data, &lasso->tag, lasso->model->Mat, &newPoint);
157 xVec3Copy(&lasso->anchor, (xVec3*)&ent->model->Mat->pos);
158 xVec3SubFrom(&newPoint, &lasso->anchor);
159
160 if (!(lasso->flags & 0x800))
161 {
162 lasso->secsLeft -= dt;
163
164 if (lasso->secsLeft < 0.0f)
165 {
166 lasso->secsLeft = 0.0f;
167 lasso->flags |= 0x800;
168 }
169
170 F32 interp = 1.0f - (lasso->secsLeft / lasso->secsTotal);
171 if (!(lasso->flags & 0x2000))
172 {
173 if (lasso->flags & 0x8)
174 {
175 fizzicalRadius(lasso, dt, &newPoint);
176 }
177 else
178 {
179 lasso->crRadius = lasso->stRadius * (1.0f - interp) + lasso->tgRadius * interp;
180 }
181
182 if (lasso->flags & 0x2)
183 {
184 fizzicalCenter(lasso, dt, &newPoint);
185 }
186 else
187 {
188 xVec3SMul(&lasso->crCenter, &lasso->stCenter, 1.0f - interp);
189 xVec3AddScaled(&lasso->crCenter, &lasso->tgCenter, interp);
190 xVec3SubFrom(&lasso->crCenter, &lasso->anchor);
191 }
192
193 if (lasso->flags & 0x4)
194 {
195 fizzicalNormal(lasso, dt, &newPoint);
196 }
197 else
198 {
199 xVec3SMul(&lasso->crNormal, &lasso->stNormal, 1.0f - interp);
200 xVec3AddScaled(&lasso->crNormal, &lasso->tgNormal, interp);
201 }
202
203 xVec3SMulBy(&lasso->crNormal, 1.0f / xVec3Length(&lasso->crNormal));
204
205 if (lasso->flags & 0x10)
206 {
207 fizzicalHonda(lasso, dt, &newPoint);
208 }
209 else
210 {

Callers

nothing calls this directly

Calls 13

xVec3CopyFunction · 0.85
xVec3SubFromFunction · 0.85
fizzicalRadiusFunction · 0.85
fizzicalCenterFunction · 0.85
xVec3SMulFunction · 0.85
xVec3AddScaledFunction · 0.85
fizzicalNormalFunction · 0.85
xVec3SMulByFunction · 0.85
xVec3LengthFunction · 0.85
fizzicalHondaFunction · 0.85
nonfizzicalHondaFunction · 0.85
fizzicalSlackFunction · 0.85

Tested by

no test coverage detected