4.9.Welded Body Driver
The Welded Body Driver is a feature of the VREPhysicalAnimationComponent subclass of the engines Physical Animation Component that adds in some additional useful tools on top of it. The primary intent of the Welded Body Driver is to provide a method of driving animated skeletal objects by animation but keeping them stable during simulation.
This is a more stable method than the physical animation component as it is working off of welded bodies and there are not joints holding them together. It is best used on small bones or things that need to remain entirely stable, while the physical animation components normal feature set is better for bones like arm and spines that need to be separately manipulatable.
The templates Grasping Hand utilizes this to drive the animations in its physical hand mode.
To check out its implementation, load up the GraspingPhysics blueprint in the template (testing/graspinghands/graspingphysics).
To see the welded sub bodies you can enable the following in the bone tree:
Then you can see that I generated collision bodies for all of the bones in the skeleton, and then named them to the bone that they are a child of. Afterwards each was seperately welded on to the root hand_r bone to create this tree:
This is the data that the welded body driver uses, it matches the body name to a bones name in the child array of the given bone and drives it to match the bone.
In the blueprint setup after you have added a VREPhysicalAnimationComponent you at some point call SetupWeldedBoneDriver with the given base bone name that the bodies are welded on to.
This will auto generate a map of the bodies / bones to track and OnTick of the component will ensure that they match. If you change something regarding the skeleton (simulate / unsimulate for instance which re-creates the bodies) then you can call RefreshWeldedBodyDriver to have it re-map the body and bones.