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

Function xModelEvalSingle

src/SB/Core/x/xModel.cpp:292–342  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

290}
291
292void xModelEvalSingle(xModelInstance* modelInst)
293{
294 S32 i;
295 U16 flags = modelInst->Flags;
296 if (flags & 0x2)
297 {
298 modelInst->Flags = flags & (U16)~0x1000;
299
300 if (modelInst->Anim)
301 {
302 xAnimPlayEval(modelInst->Anim);
303 }
304
305 xModelInstance* dad = modelInst->Parent;
306 if (dad)
307 {
308 if (flags & 0x8)
309 {
310 memcpy(modelInst->Mat, dad->Mat, (modelInst->BoneCount + 1) * sizeof(RwMatrix));
311 }
312 else if (flags & 0x10)
313 {
314 U8* remap = modelInst->BoneRemap;
315 memcpy(modelInst->Mat, dad->Mat, sizeof(RwMatrix));
316 for (i = 0; i < modelInst->BoneCount; i++)
317 {
318 memcpy(&modelInst->Mat[i + 1], &dad->Mat[remap[i] + 1], sizeof(RwMatrix));
319 }
320 }
321 else if (flags & 0x20)
322 {
323 if (dad->BoneCount && modelInst->BoneIndex)
324 {
325 xMat4x3Mul((xMat4x3*)modelInst->Mat,
326 (xMat4x3*)&dad->Mat[modelInst->BoneIndex + 1], (xMat4x3*)dad->Mat);
327 }
328 else
329 {
330 memcpy(modelInst->Mat, dad->Mat, sizeof(RwMatrix));
331 }
332
333 if (flags & 0x40)
334 {
335 xMat4x3Mul((xMat4x3*)modelInst->Mat,
336 (xMat4x3*)&modelInst->Mat[modelInst->BoneCount + 1],
337 (xMat4x3*)modelInst->Mat);
338 }
339 }
340 }
341 }
342}
343
344void xModelEval(xModelInstance* model)
345{

Callers 1

xModelEvalFunction · 0.70

Calls 3

memcpyFunction · 0.85
xMat4x3MulFunction · 0.85
xAnimPlayEvalFunction · 0.70

Tested by

no test coverage detected