| 290 | } |
| 291 | |
| 292 | void 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 | |
| 344 | void xModelEval(xModelInstance* model) |
| 345 | { |
no test coverage detected