mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-12-07 16:42:36 +00:00
fixed rotation interp logic
This commit is contained in:
parent
91f42e84dc
commit
93f7ad4c13
1 changed files with 5 additions and 5 deletions
|
|
@ -137,14 +137,14 @@ void patch_djui_hud(f32 delta) {
|
|||
// rotate
|
||||
f32 translatedW = scaleW;
|
||||
f32 translatedH = scaleH;
|
||||
s32 rotation = delta_interpolate_s32(sRotation.rotation - sRotation.rotationDiff, sRotation.rotation, delta);
|
||||
f32 pivotX = delta_interpolate_f32(sRotation.prevPivotX, sRotation.pivotX, delta);
|
||||
f32 pivotY = delta_interpolate_f32(sRotation.prevPivotY, sRotation.pivotY, delta);
|
||||
djui_hud_size_translate(&translatedW);
|
||||
djui_hud_size_translate(&translatedH);
|
||||
if (sRotation.rotationDiff != 0 || sRotation.rotation != 0) {
|
||||
f32 pivotTranslationX = translatedW * pivotX;
|
||||
f32 pivotTranslationY = translatedH * pivotY;
|
||||
s32 rotation = delta_interpolate_s32(sRotation.rotation - sRotation.rotationDiff, sRotation.rotation, delta);
|
||||
f32 pivotX = delta_interpolate_f32(sRotation.prevPivotX, sRotation.pivotX, delta);
|
||||
f32 pivotY = delta_interpolate_f32(sRotation.prevPivotY, sRotation.pivotY, delta);
|
||||
f32 pivotTranslationX = interp->width * translatedW * pivotX;
|
||||
f32 pivotTranslationY = interp->height * translatedH * pivotY;
|
||||
create_dl_translation_matrix(DJUI_MTX_NOPUSH, +pivotTranslationX, -pivotTranslationY, 0);
|
||||
create_dl_rotation_matrix(DJUI_MTX_NOPUSH, rotation, 0, 0, 1);
|
||||
create_dl_translation_matrix(DJUI_MTX_NOPUSH, -pivotTranslationX, +pivotTranslationY, 0);
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue