-
-
Notifications
You must be signed in to change notification settings - Fork 35.5k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add blendFactor support to CCDIKSolver #30406
Conversation
Added ability to control IK influence through blend factors: - Global blendFactor in update() method - Per-chain blendFactor in updateOne() method - Default value of 1.0 maintains backward compatibility
Co-authored-by: renovate[bot] <29139614+renovate[bot]@users.noreply.github.com>
@@ -63,16 +62,17 @@ class CCDIKSolver { | |||
|
|||
/** | |||
* Update all IK bones. | |||
* | |||
* @param {number} [globalBlendFactor=1.0] - Blend factor applied if an IK chain doesn't have its own .blendFactor. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Formatting seems to be broken here.
for ( let j = 0; j < links.length; j ++ ) { | ||
|
||
const linkIndex = links[ j ].index; | ||
initialQuaternions[ j ] = bones[ linkIndex ].quaternion.clone(); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This method is called for every animation step for each IK bone for all its links. It is unacceptable to use clone()
in such hot code paths.
limitation.y * c2, | ||
limitation.z * c2, | ||
c | ||
); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Please avoid reformatting so it's easier to see what you actually change in the source file.
* TSLEncoder: Fix number imports. * GLSLDecoder: Improve uint support. * GLSLDecoder: Fix CodeQL feedback.
Co-authored-by: Samuel Rigaud <[email protected]>
Co-authored-by: Samuel Rigaud <[email protected]>
📦 Bundle sizeFull ESM build, minified and gzipped.
🌳 Bundle size after tree-shakingMinimal build including a renderer, camera, empty scene, and dependencies.
|
Description
Added ability to control IK influence through blend factors:
Use Case
I was developing an animation + procedural animation system and needed smooth interpolation between animation clips and IK implementation. Since the overrides happen in the CCDIKSolver, modifying it to support blending was necessary.
Usage Example
CS_009266.2025-01.mp4
Alternative Approaches Considered