source-sdk-2013 icon indicating copy to clipboard operation
source-sdk-2013 copied to clipboard

matsys_controls: Add inverse kinematics solving in model panels

Open copperpixel opened this issue 5 months ago • 0 comments

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
medic_medigun_unfixed medic_medigun_fixed
Before (hand clipping through grip) After
scout_pistol_unfixed scout_pistol_fixed
Before (hand not attached to shotgun forend) After
pyro_shotgun_unfixed pyro_shotgun_fixed

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.

copperpixel avatar Jul 12 '25 12:07 copperpixel