8000 fix: incorrect handling of viewpoints in GenericPlatform by bdunderscore · Pull Request #642 · bdunderscore/ndmf · GitHub
[go: up one dir, main page]
More Web Proxy on the site http://driver.im/
Skip to content

fix: incorrect handling of viewpoints in GenericPlatform #642

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

Merged
merged 1 commit into from
May 29, 2025

Conversation

bdunderscore
Copy link
Owner

No description provided.

@Copilot Copilot AI review requested due to automatic review settings May 29, 2025 03:37
Copy link
Contributor
@Copilot 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 fixes the incorrect handling of viewpoint coordinates by removing the local space conversion and directly assigning world coordinates.

  • Removed InverseTransformPoint usage in Assigning EyePosition in ExtractCommonAvatarInfo.
  • Removed InverseTransformPoint in InitEyePosition to set viewpoint.transform.position directly.

@@ -46,7 +46,7 @@ public CommonAvatarInfo ExtractCommonAvatarInfo(GameObject avatarRoot)
throw new InvalidOperationException("Multiple NDMF Viewpoint components found");
}

cai.EyePosition = avatarRoot.transform.InverseTransformPoint(viewpoint[0].transform.position);
cai.EyePosition = viewpoint[0].transform.position;
Copy link
Preview
Copilot AI May 29, 2025

Choose a reason for hiding this comment

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

Consider adding a comment to clarify that the eye position is now intended to be treated as a world coordinate, aligning with the updated behavior.

Copilot uses AI. Check for mistakes.

@@ -156,7 +156,7 @@ private void InitEyePosition(GameObject avatarRoot, Vector3 eyePosition)
viewpoint = viewpoints[0];
}

viewpoint.transform.position = avatarRoot.transform.InverseTransformPoint(eyePosition);
viewpoint.transform.position = eyePosition;
Copy link
Preview
Copilot AI May 29, 2025

Choose a reason for hiding this comment

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

Consider documenting that the eyePosition passed into InitEyePosition is expected to be in world coordinates, ensuring consistency with the change made in ExtractCommonAvatarInfo.

Copilot uses AI. Check for mistakes.

Copy link
Contributor
@Copilot 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 fixes an incorrect coordinate transformation in GenericPlatform that was affecting the positioning of viewpoints.

Reviewed Changes

Copilot reviewed 2 out of 2 changed files in this pull request and generated no comments.

File Description
Editor/Platform/GenericPlatform.cs Corrects coordinate conversion for viewpoint positioning by using TransformPoint.
CHANGELOG-PRERELEASE.md Updates the changelog with a note referencing the bug fix for NDMFViewpoint.
Comments suppressed due to low confidence (1)

Editor/Platform/GenericPlatform.cs:159

  • The change from InverseTransformPoint to TransformPoint is intended to correct the coordinate conversion for eyePosition. Please ensure that eyePosition is provided in local space so that the use of TransformPoint yields the correct world space position.
viewpoint.transform.position = avatarRoot.transform.TransformPoint(eyePosition);

@bdunderscore bdunderscore enabled auto-merge (squash) May 29, 2025 03:51
@bdunderscore bdunderscore merged commit f9969c5 into main May 29, 2025
8 of 9 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant
0