source-sdk-2013
source-sdk-2013 copied to clipboard
matsys_controls: Add inverse kinematics solving in model panels
Description
Tier3's MDL utility class that's used in CMDLPanel doesn't account for IK, causing for instance attached weapons to not be positioned correctly when a playermodel is looking at a certain angles or in some cases during the idle animation. An example of this being an issue is on TF's loadout menu with Scout's pistols, the Shortstop and all the Medi Guns:
| Before (hand clipping through handle) | After |
|---|---|
| Before (hand clipping through grip) | After |
|---|---|
| Before (hand not attached to shotgun forend) | After |
|---|---|
To resolve this, this PR implements a custom bones setup routine in CMDLPanel that properly applies IK to the model.
If this were to be merged, it would be probably better if CMDL::SetUpBones in tier3 was updated with IK solving instead.