mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2025-01-22 07:32:07 -05:00
cleaner fix for headPos bug nametags
This commit is contained in:
parent
3c0e14f9ef
commit
9ddc7311f1
3 changed files with 6 additions and 4 deletions
|
@ -317,6 +317,7 @@ struct MarioBodyState
|
|||
/*????*/ Vec3f handFootPos[4];
|
||||
/*????*/ u32 updateTorsoTime;
|
||||
/*????*/ Vec3f headPos;
|
||||
/*????*/ u32 updateHeadPosTime;
|
||||
/*????*/ u16 shadeR; /// shadow red value
|
||||
/*????*/ u16 shadeG; /// shadow green value
|
||||
/*????*/ u16 shadeB; /// shadow blue value
|
||||
|
|
|
@ -432,7 +432,7 @@ Gfx* geo_mario_tilt_torso(s32 callContext, struct GraphNode* node, Mat4* mtx) {
|
|||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
struct GraphNodeRotation* rotNode = (struct GraphNodeRotation*) node->next;
|
||||
|
||||
if (action != ACT_BUTT_SLIDE && action != ACT_HOLD_BUTT_SLIDE && action != ACT_WALKING && action != ACT_RIDING_SHELL_GROUND
|
||||
if (action != ACT_BUTT_SLIDE && action != ACT_HOLD_BUTT_SLIDE && action != ACT_WALKING && action != ACT_RIDING_SHELL_GROUND
|
||||
&& !bodyState->allowPartRotation) {
|
||||
vec3s_copy(bodyState->torsoAngle, gVec3sZero);
|
||||
}
|
||||
|
@ -490,6 +490,7 @@ Gfx* geo_mario_head_rotation(s32 callContext, struct GraphNode* node, Mat4* c) {
|
|||
get_pos_from_transform_mtx(bodyState->headPos,
|
||||
*c,
|
||||
*gCurGraphNodeCamera->matrixPtr);
|
||||
bodyState->updateHeadPosTime = gGlobalTimer;
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
|
@ -80,12 +80,12 @@ void nametags_render(void) {
|
|||
continue;
|
||||
}
|
||||
|
||||
if (!djui_hud_world_pos_to_screen_pos(m->marioObj->header.gfx.pos, (Vec3f){})) { continue; }
|
||||
if (m->marioBodyState->updateHeadPosTime != gGlobalTimer) { continue; }
|
||||
|
||||
Vec3f pos;
|
||||
Vec3f out;
|
||||
vec3f_copy(pos, m->marioObj->header.gfx.pos);
|
||||
pos[1] += 200;
|
||||
vec3f_copy(pos, m->marioBodyState->headPos);
|
||||
pos[1] += 100;
|
||||
|
||||
if (djui_hud_world_pos_to_screen_pos(pos, out) &&
|
||||
(i != 0 || (i == 0 && m->action != ACT_FIRST_PERSON))) {
|
||||
|
|
Loading…
Reference in a new issue