Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion frontend/src/components/Avatar/VRMAvatar.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -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.
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.

// 初期状態で目を開ける
if (vrm.expressionManager) {
Expand Down