| 337 | } |
| 338 | |
| 339 | static void xEntOrbitMove(xEntMotion* motion, xScene* sc, F32 dt, xEntFrame* frame) |
| 340 | { |
| 341 | F32 rem = dt * 0.5f; |
| 342 | F32 u = motion->orb.w * (motion->t + rem); |
| 343 | F32 th = isin(motion->orb.w * rem); |
| 344 | F32 newt = motion->t - motion->orb.p; |
| 345 | |
| 346 | if (newt > 0.0f) |
| 347 | { |
| 348 | motion->t = newt; |
| 349 | } |
| 350 | |
| 351 | if ((-newt < dt) && (-newt > 0.0f)) |
| 352 | { |
| 353 | xVec3Sub(&frame->dpos, &motion->orb.orig, &frame->mat.pos); |
| 354 | } |
| 355 | else |
| 356 | { |
| 357 | frame->dpos.x = (2.0f * th) * motion->orb.a * isin(u); |
| 358 | frame->dpos.y = 0.0f; |
| 359 | frame->dpos.z = (-2.0f * th) * motion->orb.b * icos(u); |
| 360 | } |
| 361 | |
| 362 | frame->mode = 2; |
| 363 | } |
| 364 | |
| 365 | void xEntMPGetNext(xEntMotion* motion, xMovePoint* prev, xScene* sc) |
| 366 | { |
no test coverage detected