-
Notifications
You must be signed in to change notification settings - Fork 575
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Player doc: some rotation logic/data #1443
base: main
Are you sure you want to change the base?
Changes from 4 commits
33fcb7c
0683296
05b3d51
7e14223
0b9e965
7190cb5
1f06c20
988199b
02b5701
9729589
436e60d
50a1f24
cbad30d
2b8bb6d
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -473,6 +473,16 @@ typedef void (*PlayerFunc674)(struct Player*, struct PlayState*); | |||||
typedef s32 (*PlayerFunc82C)(struct Player*, struct PlayState*); | ||||||
typedef void (*PlayerFuncA74)(struct PlayState*, struct Player*); | ||||||
|
||||||
#define NOREST_ROT_FOCUS_X (1 << 0) | ||||||
#define NOREST_ROT_FOCUS_Y (1 << 1) | ||||||
#define NOREST_ROT_FOCUS_Z (1 << 2) | ||||||
#define NOREST_ROT_HEAD_X (1 << 3) | ||||||
#define NOREST_ROT_HEAD_Y (1 << 4) | ||||||
#define NOREST_ROT_HEAD_Z (1 << 5) | ||||||
#define NOREST_ROT_UPPER_X (1 << 6) | ||||||
#define NOREST_ROT_UPPER_Y (1 << 7) | ||||||
#define NOREST_ROT_UPPER_Z (1 << 8) | ||||||
|
||||||
typedef struct Player { | ||||||
/* 0x0000 */ Actor actor; | ||||||
/* 0x014C */ s8 currentTunic; // current tunic from `PlayerTunic` | ||||||
|
@@ -560,15 +570,11 @@ typedef struct Player { | |||||
/* 0x06A8 */ Actor* unk_6A8; | ||||||
/* 0x06AC */ s8 unk_6AC; | ||||||
/* 0x06AD */ u8 unk_6AD; | ||||||
/* 0x06AE */ u16 unk_6AE; | ||||||
/* 0x06B0 */ s16 unk_6B0; | ||||||
/* 0x06AE */ u16 rotsNoRestFlags; // See `NOREST_ROT_` macros. If its flag isn't set, a rot steps to a rest value. | ||||||
/* 0x06B0 */ s16 upperLimbYawSecondary; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
Maybe? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why not "secondary" is because if (!(this->rotsNoRestFlags & NOREST_ROT_UPPER_Y)) {
if (this->upperLimbYawSecondary != 0) {
Player_ApproachZeroBinang(&this->upperLimbYawSecondary);
} else {
Player_ApproachZeroBinang(&this->upperLimbRot.y);
}
} , it steps this one to 0 before the main one |
||||||
/* 0x06B2 */ char unk_6B4[0x004]; | ||||||
/* 0x06B6 */ s16 unk_6B6; | ||||||
/* 0x06B8 */ s16 unk_6B8; | ||||||
/* 0x06BA */ s16 unk_6BA; | ||||||
/* 0x06BC */ s16 unk_6BC; | ||||||
/* 0x06BE */ s16 unk_6BE; | ||||||
/* 0x06C0 */ s16 unk_6C0; | ||||||
/* 0x06B6 */ Vec3s headLimbRot; | ||||||
/* 0x06BC */ Vec3s upperLimbRot; | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Is There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. It corresponds to |
||||||
/* 0x06C2 */ s16 unk_6C2; | ||||||
/* 0x06C4 */ f32 unk_6C4; | ||||||
/* 0x06C8 */ SkelAnime skelAnime2; | ||||||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why "No Rest"?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
when the flag is set, the rotation does not step to a rest value
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I see. Next question, what is a rest value? Something like the idle value?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
That's a good question and I'm open to suggestions on changing that
I got the term from Blender (a 3d modeling piece of software https://www.blender.org/ ), let me define a few terms
For example when animated the armature has a different pose every frame
The "rest pose" is the pose the armature has when all its bones aren't transformed (all rotations/translations/... are 0/identity)
Back to OoT, all rotations involved with
NOREST_ROT_
are stepped to 0 when their flag isn't setFor all these rotations, 0 corresponds visually to a neutral pose of Link, with only the animation affecting his bones, so I refered to those as "rest" values
Also the use case for these flags is when setting these rots to specific values, typically to look at something, which also can be seen as deviating from the "rest" animation-provided pose
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Could you maybe think of this as a "hold and release" system? So the
rot
is held to a target when the flag is set, and released back to rest when the flag is unset? So something likeHOLD_ROT_
? Or would that conflate with the "HOLD" action of "holding" something above Link's Head?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe it's because
no rest
is two words, so it feels more separate, whilenon-rest
is one word, so it's easier to group together as a single concept?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I need to review the pr in full again, but I think in general itd be good to try a positive name instead of a negative one, like "modified" instead of "no rest" (which i interpret to mean "non default, offset from the rotation the animation is applying)
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
It is related to three rotations / rotation offsets: focus, head, upper (body)
I'm not sure what's up with the focus one, but head and upper are I guess used to make Link face something
The flags control if these rotations are stepped toward "0" (not actually always 0 but something that is "normal"/"default" hence "rest")
Phrased this way it makes it arduous to make a positive name but I'm not sure how to phrase it another way
maybe like "flag set = rot is active" but idk I don't have many ideas
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
From what I can tell down below, it seems like setting this flag just stops rotation back to the rest position (0). You might have been slightly joking, but
activeRot
doesn't seem too bad. Could possibly also do something likestayRot/remainRot
, or maybekeepRot
?There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Just brainstorming: what about something a little more general like
overrideRot
oroverrideRotFlags
, and leave it to the comments to describe that the default behaviour is to restore the rot to resting position, and that by setting this flag, it gives you manual control to control the rotations?