Skip to content

Commit

Permalink
Merge pull request #1525 from pixiv/improve-animation-hips-warning
Browse files Browse the repository at this point in the history
fix: VRMAnimationLoaderPlugin, Improve hips position warning
  • Loading branch information
0b5vr authored Nov 8, 2024
2 parents acda26a + e27e182 commit 8969c04
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions packages/three-vrm-animation/src/VRMAnimationLoaderPlugin.ts
Original file line number Diff line number Diff line change
Expand Up @@ -77,11 +77,11 @@ export class VRMAnimationLoaderPlugin implements GLTFLoaderPlugin {
const restHipsPosition = new THREE.Vector3();
hips?.getWorldPosition(restHipsPosition);

// If the rest hips position is approximately zero,
// If the y component of the rest hips position is approximately zero or below,
// it is considered that the animation violates the VRM T-pose
if (restHipsPosition.lengthSq() < 1e-6) {
if (restHipsPosition.y < 1e-3) {
console.warn(
'VRMAnimationLoaderPlugin: The loaded VRM Animation violates the VRM T-pose (The rest hips position is approximately zero.)',
'VRMAnimationLoaderPlugin: The loaded VRM Animation might violate the VRM T-pose (The y component of the rest hips position is approximately zero or below.)',
);
}

Expand Down

0 comments on commit 8969c04

Please sign in to comment.