Skip to content

fix: アバターの位置元に戻した#208

Open
miyabi206 wants to merge 1 commit intomainfrom
fix/avatar_location
Open

fix: アバターの位置元に戻した#208
miyabi206 wants to merge 1 commit intomainfrom
fix/avatar_location

Conversation

@miyabi206
Copy link
Copy Markdown
Collaborator

No description provided.

Copilot AI review requested due to automatic review settings December 11, 2025 02:10
@vercel
Copy link
Copy Markdown
Contributor

vercel bot commented Dec 11, 2025

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Preview Comments Updated (UTC)
renai Error Error Dec 11, 2025 2:12am

Copy link
Copy Markdown

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.4 vertical 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%の位置(膝の位置)
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
const kneeOffset = size.y * 0.5; // モデルの高さの30%の位置(膝の位置
const kneeOffset = size.y * 0.5; // モデルの高さの50%の位置(腰の位置付近

Copilot uses AI. Check for mistakes.
// モデルの膝の位置を計算して、膝から上が見えるように配置
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; // 元に戻した
Copy link

Copilot AI Dec 11, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.

Suggested change
scene.position.y = -kneeOffset * (targetHeight / size.y) * 4; // 元に戻した
// モデルの膝から上が見えるようにY座標をオフセットして、上半身を中心に表示する
scene.position.y = -kneeOffset * (targetHeight / size.y) * 4;

Copilot uses AI. Check for mistakes.
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