| 535 | } |
| 536 | |
| 537 | static void xEntPenMove(xEntMotion* motion, xScene* sc, F32 dt, xEntFrame* frame) |
| 538 | { |
| 539 | xEntPenData* pen = &motion->pen; |
| 540 | xEntMotionPenData* aspen = &motion->asset->pen; |
| 541 | F32 th = (dt * 0.5f) * pen->w; |
| 542 | F32 rem = motion->t + (dt * 0.5f); |
| 543 | F32 dangle = (aspen->range * 2.0f) * isin(th) * icos((rem * pen->w) + aspen->phase); |
| 544 | F32 newt = motion->t - aspen->period; |
| 545 | |
| 546 | if (newt > 0.0f) |
| 547 | { |
| 548 | motion->t = motion->t - aspen->period; |
| 549 | } |
| 550 | |
| 551 | if ((-newt < dt) && (-newt > 0.0f)) |
| 552 | { |
| 553 | xMat4x3Copy(&frame->mat, &motion->pen.omat); |
| 554 | frame->mode = 0x11; |
| 555 | } |
| 556 | else |
| 557 | { |
| 558 | xMat4x3 delta_mat; |
| 559 | xMat4x3Rot(&delta_mat, &frame->mat.at, dangle, &pen->top); |
| 560 | xMat4x3Mul(&frame->mat, &frame->mat, &delta_mat); |
| 561 | frame->mode = 0x41; |
| 562 | } |
| 563 | } |
| 564 | |
| 565 | static void xEntMechMove(xEntMotion* motion, xScene* sc, F32 dt, xEntFrame* frame) |
| 566 | { |
no test coverage detected