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

Function zShrapnel_CinematicInit

src/SB/Game/zShrapnel.cpp:291–327  ·  view source on GitHub ↗

equivalent

Source from the content-addressed store, hash-verified

289
290// equivalent
291void zShrapnel_CinematicInit(zShrapnelAsset* shrap, RpAtomic* cinModel, RwMatrixTag* animMat,
292 xVec3* initVel, void (*cb)(zFrag*, zFragAsset*))
293{
294 if (cinModel == NULL || shrap == NULL || animMat == NULL)
295 return;
296
297 zFrag* frag = zFrag_Alloc(eFragProjectile);
298 frag->parent[0] = NULL;
299 frag->parent[1] = NULL;
300 sCinProj.modelFile = cinModel;
301
302 zFrag_DefaultInit(frag, &sCinProj);
303
304 xModelInstance* model = frag->info.projectile.model;
305 if (model == NULL)
306 {
307 zFrag_Free(frag);
308 }
309 else
310 {
311 model->Data = sCinModel;
312 xMat3x3Copy((xMat4x3*)model->Mat, &g_I3);
313 xVec3Copy((xVec3*)&model->Mat->pos, (xVec3*)&animMat->pos);
314
315 for (S32 i = 1; i < model->BoneCount; i++)
316 {
317 xMat4x3Copy((xMat4x3*)model->Mat + i, (xMat4x3*)animMat + i);
318 }
319
320 sCinCB = cb;
321 sCinFrag = frag;
322 shrap->initCB(shrap, model, initVel, CinFragCB);
323 sCinCB = NULL;
324 sCinFrag = NULL;
325 sCinProj.modelFile = NULL;
326 }
327}
328
329void zFragLoc_Setup(zFragLocation* loc, xModelInstance* parent)
330{

Callers

nothing calls this directly

Calls 6

zFrag_FreeFunction · 0.85
xMat3x3CopyFunction · 0.85
xVec3CopyFunction · 0.85
xMat4x3CopyFunction · 0.85
zFrag_AllocFunction · 0.70
zFrag_DefaultInitFunction · 0.70

Tested by

no test coverage detected