#######################################################################################################################* *-----------------------------------------------LocalInterpolationComponent-----------------------------------------------* *#########################################################################################################################*/
| 416 | *-----------------------------------------------LocalInterpolationComponent-----------------------------------------------* |
| 417 | *#########################################################################################################################*/ |
| 418 | static void LocalInterpComp_SetPosition(struct Entity* e, struct LocationUpdate* update, int mode) { |
| 419 | float yOffset; |
| 420 | |
| 421 | if (mode == LU_POS_ABSOLUTE_INSTANT || mode == LU_POS_ABSOLUTE_SMOOTH) { |
| 422 | e->next.pos = update->pos; |
| 423 | } else if (mode == LU_POS_RELATIVE_SMOOTH) { |
| 424 | Vec3_AddBy(&e->next.pos, &update->pos); |
| 425 | } else if (mode == LU_POS_RELATIVE_SHIFT) { |
| 426 | Vec3_AddBy(&e->prev.pos, &update->pos); |
| 427 | Vec3_AddBy(&e->next.pos, &update->pos); |
| 428 | } |
| 429 | |
| 430 | /* If server sets Y position exactly on ground, push up a tiny bit */ |
| 431 | yOffset = e->next.pos.y - Math_Floor(e->next.pos.y); |
| 432 | if (yOffset < ENTITY_ADJUSTMENT) e->next.pos.y += ENTITY_ADJUSTMENT; |
| 433 | |
| 434 | if (mode == LU_POS_ABSOLUTE_INSTANT) { |
| 435 | e->prev.pos = e->next.pos; e->Position = e->next.pos; |
| 436 | } |
| 437 | } |
| 438 | |
| 439 | static void LocalInterpComp_Angle(float* prev, float* next, float value, cc_bool interpolate) { |
| 440 | value = Math_ClampAngle(value); |
no test coverage detected