| 70 | } |
| 71 | |
| 72 | void xMovePointSplineSetup(xMovePoint* m) |
| 73 | { |
| 74 | xMovePoint *w0, *w1, *w2, *w3; |
| 75 | xVec3 points[2]; |
| 76 | xVec3 p1, p2; |
| 77 | |
| 78 | if (m->asset->bezIndex != 1) |
| 79 | return; |
| 80 | if (m->spl) |
| 81 | return; |
| 82 | |
| 83 | w0 = m->prev; |
| 84 | w1 = m; |
| 85 | w2 = m->nodes[0]; |
| 86 | |
| 87 | points[0] = *w0->pos; |
| 88 | if (w2->asset->bezIndex > 0) |
| 89 | { |
| 90 | w3 = w2->nodes[0]; |
| 91 | p1 = *w1->pos; |
| 92 | p2 = *w2->pos; |
| 93 | points[1] = *w3->pos; |
| 94 | } |
| 95 | else |
| 96 | { |
| 97 | p1.x = (1 / 3.f) * w0->pos->x + (2 / 3.f) * w1->pos->x; |
| 98 | p1.y = (1 / 3.f) * w0->pos->y + (2 / 3.f) * w1->pos->y; |
| 99 | p1.z = (1 / 3.f) * w0->pos->z + (2 / 3.f) * w1->pos->z; |
| 100 | p2.x = (2 / 3.f) * w1->pos->x + (1 / 3.f) * w2->pos->x; |
| 101 | p2.y = (2 / 3.f) * w1->pos->y + (1 / 3.f) * w2->pos->y; |
| 102 | p2.z = (2 / 3.f) * w1->pos->z + (1 / 3.f) * w2->pos->z; |
| 103 | points[1] = *w2->pos; |
| 104 | } |
| 105 | |
| 106 | m->spl = xSpline3_Bezier(points, NULL, 2, 0, &p1, &p2); |
| 107 | xSpline3_ArcInit(m->spl, 20); |
| 108 | } |
| 109 | |
| 110 | F32 xMovePointGetNext(const xMovePoint* m, const xMovePoint* prev, xMovePoint** next, xVec3* hdng) |
| 111 | { |
no test coverage detected