GuilhermeGSousa / godot-motion-matching

A Motion Matching plugin for Godot 4
29 stars 5 forks source link

IK Post Processing pass using `SkeletonModifier` #18

Open GuilhermeGSousa opened 2 months ago

GuilhermeGSousa commented 2 months ago

Depending on the MMSynchronizer being used, capsule to skeleton synchronization may cause foot sliding. This requires a SkeletonModifier to use IK to lock feet in place.

GeorgeS2019 commented 2 months ago

Godot 4.4 built in IK https://github.com/GuilhermeGSousa/godot-motion-matching/discussions/29

fire commented 1 month ago

What are the expected inputs and outputs for the ik?

So I can modify my many bone ik to use this.

GuilhermeGSousa commented 1 month ago

I haven't given this much thought yet, but for feet IK we might only need the feet's bone names.

This isn't implemented yet, but we might want to run motion matching queries against world points, to do stuff like touching a wall when moving past one, touching a surface when vaulting, etc. In that case, the skeleton modifier would also need both the bones affected by IK, and the world position they must reach.

Depending on the synchronization method used to sync character capsule and character skeleton, we might also want to do some stride warping. I've used this method in Unreal, it works pretty well, it allows us to clamp the skeleton to the player capsule, then warp the leg stride of the animation to match the speed of the capsule. In that case we'd need

GuilhermeGSousa commented 1 month ago

If you want to see for yourself what these MMSynchronizer actually do, if you play the demo you'll notice that the player capsule and skeleton are two independent nodes with no parenting relationship. Without a sychronizer the only thing that allows the skeleton to follow the capsule is animation selection from motion matching. This can look good, but its often not enough and depending on the cases we need a way of sychronizing player capsule and skeleton. Depending on the approach you get different pros and cons: