mirror of
https://github.com/coop-deluxe/sm64coopdx.git
synced 2024-11-22 20:15:17 +00:00
partially fix jitter with two of the same model
This commit is contained in:
parent
843a8cd18f
commit
8f4965e05d
1 changed files with 15 additions and 2 deletions
|
@ -405,7 +405,8 @@ Gfx* geo_switch_mario_eyes(s32 callContext, struct GraphNode* node, UNUSED Mat4*
|
|||
Gfx* geo_mario_tilt_torso(s32 callContext, struct GraphNode* node, Mat4* mtx) {
|
||||
Mat4 * curTransform = mtx;
|
||||
struct GraphNodeGenerated* asGenerated = (struct GraphNodeGenerated*) node;
|
||||
struct MarioBodyState* bodyState = geo_get_body_state();
|
||||
u8 plrIdx = geo_get_processing_object_index();
|
||||
struct MarioBodyState* bodyState = &gBodyStates[plrIdx];
|
||||
s32 action = bodyState->action;
|
||||
|
||||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
|
@ -418,6 +419,11 @@ Gfx* geo_mario_tilt_torso(s32 callContext, struct GraphNode* node, Mat4* mtx) {
|
|||
rotNode->rotation[0] = bodyState->torsoAngle[1];
|
||||
rotNode->rotation[1] = bodyState->torsoAngle[2];
|
||||
rotNode->rotation[2] = bodyState->torsoAngle[0];
|
||||
if (plrIdx != 0) {
|
||||
// only interpolate angles for the local player
|
||||
vec3s_copy(rotNode->prevRotation, rotNode->rotation);
|
||||
rotNode->prevTimestamp = gGlobalTimer;
|
||||
}
|
||||
// update torso position in bodyState
|
||||
get_pos_from_transform_mtx(bodyState->torsoPos, *curTransform, *gCurGraphNodeCamera->matrixPtr);
|
||||
}
|
||||
|
@ -429,7 +435,8 @@ Gfx* geo_mario_tilt_torso(s32 callContext, struct GraphNode* node, Mat4* mtx) {
|
|||
*/
|
||||
Gfx* geo_mario_head_rotation(s32 callContext, struct GraphNode* node, UNUSED Mat4* c) {
|
||||
struct GraphNodeGenerated* asGenerated = (struct GraphNodeGenerated*) node;
|
||||
struct MarioBodyState* bodyState = geo_get_body_state();
|
||||
u8 plrIdx = geo_get_processing_object_index();
|
||||
struct MarioBodyState* bodyState = &gBodyStates[plrIdx];
|
||||
s32 action = bodyState->action;
|
||||
|
||||
if (callContext == GEO_CONTEXT_RENDER) {
|
||||
|
@ -449,6 +456,12 @@ Gfx* geo_mario_head_rotation(s32 callContext, struct GraphNode* node, UNUSED Mat
|
|||
vec3s_set(bodyState->headAngle, 0, 0, 0);
|
||||
vec3s_set(rotNode->rotation, 0, 0, 0);
|
||||
}
|
||||
|
||||
if (plrIdx != 0) {
|
||||
// only interpolate angles for the local player
|
||||
vec3s_copy(rotNode->prevRotation, rotNode->rotation);
|
||||
rotNode->prevTimestamp = gGlobalTimer;
|
||||
}
|
||||
}
|
||||
return NULL;
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue