SamVanheer / HalfLifeAssetManager

Half-Life Asset Manager, a tool to view and edit Half-Life 1 models
Other
235 stars 29 forks source link

[Suggestion] Make the player model actually stand on the ground instead of clipping through #94

Closed CS-PRO1 closed 4 years ago

CS-PRO1 commented 4 years ago

I guess the title explains it all, basically shift the player model up to preview how it stands on the ground like in-game instead of clipping through it. Would be very helpful if possible Untitled

SamVanheer commented 4 years ago

I can add an option to move the model so that its minimum bounds are flat on the ground. That's a generalized way of doing what you're asking without making it playermodel-specific.

SamVanheer commented 4 years ago

I've added 2 new buttons to the Model Display panel to center the model on the world origin (original model position) and to align the model on the ground by using either the bounding box minimum from the idle sequence or the first sequence if there is no idle sequence.

You'll notice that for models that are already aligned that they may move a tiny bit, this is because the bounding box is calculated based on the maximum extents of each vertex during the entire animation, so if any vertex moves below 0 on the Z axis it will consider that to be the bounding box minimum value.

Conversely if the minimum Z value is larger than 0 it will move the model down to match.