-
-
Notifications
You must be signed in to change notification settings - Fork 21.4k
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
Fix XR Body crouching and climbing #89103
Fix XR Body crouching and climbing #89103
Conversation
… set to "Rotation Only".
How is this handled with respect to root bone? Also, not directly related to this, but for about the position value movement, probably it needs to be multiplied by the Skeleton3D.motion_scale. |
How is the root bone "defined"? If it's defined at the bottom center of the avatar (or something similar), then I think positioning the hip bone makes sense. Since all bone positions are relative (except the root itself), that means the hip would be positioned relative to the root, and so we shouldn't have issues with that allowing the player to move through walls: it should be mostly Y position, and maybe some small X/Z variations (I guess as far as you can shift your hips over your center). |
I am not familiar with the specs of the XR controller, but if the XR tracker does not have the concept of root, then there should be an option for the movement of the XZ axis of the Hips that can be transferred to the Root. At this point, whether or not the root_bone is actually moved should also be an option. Perhaps we should be able to specify a Modifier for the RootMotionView. Well these may be a bit off-topic, but we need to consider that the option to use Hips or specify Root is missing and if it is added it may be included in the BONE_UPDATE enum. By the way, regarding motion_scale, since GodotHumanoid has the waist height as motion_scale when retargeting, it is necessary to multiply the tracker's movement delta value by motion_scale. In other words, the movement by GodotHumanoid's |
All the models I've put through the Godot Humanoid Skeleton Retargeting have the Root bone at ground level under the hips. The SkeletonProfileHumanoid has the "Root" at 0,0,0 and any minor positional issues may be automatically handled by the "Rest Fixer" or the "Fix Silhouette" features. |
The trackers don't provide movement deltas - only the tracked absolute positions and rotations. There appear to be two settings of interest with regards to scaling:
I believe the correct set of actions is:
The intended result would be that differences in player/actor size could be adjusted to fit the size of the avatars skeleton, and then the entire avatar - mesh and skeleton would be scaled to fit the world (assuming the avatar is a child of the XRBodyModifier3D). |
Then, I think the delta needs to be calculated on the XRBodyModifier3D in the same way as AnimationMixer for root_motion. It will be possible to follow up later. |
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.
All the models I've put through the Godot Humanoid Skeleton Retargeting have the Root bone at ground level under the hips. The SkeletonProfileHumanoid has the "Root" at 0,0,0 and any minor positional issues may be automatically handled by the "Rest Fixer" or the "Fix Silhouette" features.
Ok, then this change makes sense to me conceptually! I haven't tested it, though.
This PR attempts to resolve the scaling issue by:
This gives the developer the ability to modify The following video demonstrates playing with these effects: Skeleton.and.World.Scale.mp4Note: In the first half of the video I play with In the second half of the video I restore the |
dad79ff
to
85cb954
Compare
@BastiaanOlij Could you check the updated documentation with regards to node scaling and positioning. It's similar to the proposed XRHandModifier3D changes. |
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.
Looks good Malcolm.
We could (ab)use this opportunity to also mark this class as experimental. Best to get that out of the way before 4.3 releases :)
85cb954
to
6b9c84f
Compare
… set to "Rotation Only". Apply appropriate world and skeleton scaling.
6b9c84f
to
d2db147
Compare
Switched XRBodyTracker, XRBodyModifier3D, XRFaceTracker, and XRFaceModifier3D to experimental. |
Thanks! |
The XRBodyModifier3D node has a bone-update option of "Rotation Only" which is intended to preserve the lengths of bones. This is achieved by only setting the bone rotation rather than applying both rotation and position.
Unfortunately this option also skipped setting the "Hips" bone position which is the first actual bone of the body. As a result the players hips are fixed at the height of the T-Posed character.
The fix is to always set the Hips bone position and rotation to position the character, and then all child bones are updated as configured by the bone-update setting.
The following video demonstrates how this change affects character models performing different actions which affect vertical height:
Hips.Joint.PR.mp4