Skip to content

Comments

Easing and correct scaling for .anms, custom pivot points#436

Merged
themrdemonized merged 3 commits intothemrdemonized:damoldavskyfrom
damoldavskiy:anms_refactor
Feb 18, 2026
Merged

Easing and correct scaling for .anms, custom pivot points#436
themrdemonized merged 3 commits intothemrdemonized:damoldavskyfrom
damoldavskiy:anms_refactor

Conversation

@damoldavskiy
Copy link
Contributor

@damoldavskiy damoldavskiy commented Feb 17, 2026

The default blending code just multiplies the entire .anm transform matrix by blending * power, and sets the diagonal to one. This has several issues:

  1. The transform becomes non-orthonormal, because rotation vectors are not normalized. That means, with some .anms the weapon is going to stretch in a weird way
  2. Practically the rotation amount is limited. For example, .anm can't rotate the weapon 90 degree to the side
  3. The blending is applied to rotation vectors directly, meaning the rotation speed isn't linear
  4. The blending itself is linear parameter so it doesn't feel natural

To fix those, I convert rotation transform to a quaternion and apply slerp to ensure constant spherical speed of blended rotation (while translation is applied as before). Also, an interpolation func is applied to blend amount to make large-amplitude movements more or less natural looking.

Also added support for playing anms around custom pivot points.

Fixed blend_move_anims command to affect weapons with GLs as well.

@damoldavskiy damoldavskiy marked this pull request as draft February 17, 2026 14:19
@damoldavskiy damoldavskiy marked this pull request as ready for review February 17, 2026 15:27
@damoldavskiy damoldavskiy changed the title Easing and correct scaling for .anms, fix for blend_move_anims+gls Easing and correct scaling for .anms, custom pivot points Feb 17, 2026
@themrdemonized themrdemonized changed the base branch from all-in-one-vs2022-wpo to damoldavsky February 18, 2026 19:18
@themrdemonized themrdemonized merged commit 30ab3bc into themrdemonized:damoldavsky Feb 18, 2026
17 of 18 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants