Conversation
|
The latest updates on your projects. Learn more about Vercel for GitHub.
|
There was a problem hiding this comment.
Pull request overview
This PR reverts the avatar's Y-position offset to its original value by removing a + 0.4 adjustment that was previously added. The change affects how VRM avatars are positioned vertically in the scene.
Key Changes
- Removed the
+ 0.4vertical offset from the avatar positioning calculation - Updated the inline comment to indicate this is a reversion
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
| @@ -318,7 +318,7 @@ export default function VRMAvatar({ | |||
| // 膝まで映るように上半身を中心に表示するようにオフセット(スケール後に調整) | |||
| // モデルの膝の位置を計算して、膝から上が見えるように配置 | |||
| const kneeOffset = size.y * 0.5; // モデルの高さの30%の位置(膝の位置) | |||
There was a problem hiding this comment.
The comment states "モデルの高さの30%の位置(膝の位置)" (30% of model height, knee position), but the calculation uses 0.5, which represents 50% of the model height. This inconsistency between the comment and code could lead to confusion during future maintenance. The comment should be updated to reflect the actual calculation.
| const kneeOffset = size.y * 0.5; // モデルの高さの30%の位置(膝の位置) | |
| const kneeOffset = size.y * 0.5; // モデルの高さの50%の位置(腰の位置付近) |
| // モデルの膝の位置を計算して、膝から上が見えるように配置 | ||
| const kneeOffset = size.y * 0.5; // モデルの高さの30%の位置(膝の位置) | ||
| scene.position.y = -kneeOffset * (targetHeight / size.y) * 4 + 0.4; // 膝から上を画面に収める | ||
| scene.position.y = -kneeOffset * (targetHeight / size.y) * 4; // 元に戻した |
There was a problem hiding this comment.
The comment now says "元に戻した" (returned to original), which describes what was done rather than explaining what the code does. This makes it difficult for future developers to understand the purpose of this positioning calculation. Consider updating the comment to explain the actual purpose of this Y-position offset calculation.
| scene.position.y = -kneeOffset * (targetHeight / size.y) * 4; // 元に戻した | |
| // モデルの膝から上が見えるようにY座標をオフセットして、上半身を中心に表示する | |
| scene.position.y = -kneeOffset * (targetHeight / size.y) * 4; |
No description provided.