Skip to content
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

Fix points raycast #1342

Merged
merged 2 commits into from
May 8, 2023
Merged

Fix points raycast #1342

merged 2 commits into from
May 8, 2023

Conversation

promontis
Copy link
Contributor

@promontis promontis commented Mar 14, 2023

There are two issues:

  1. _position is the world position. In the original code, _position is retrieved from the bufferattribute which is local position

  2. the matrix that is applied in the original code is the parent matrixWorld. This is also in line with the line 58.

There are two issues:

1. `_position` is the the world position. In the original code, _position is retrieved from the bufferattribute which is local position

2. the matrix that is applied in the original code is the parent matrixWorld. This is also in line with the line 58.
@vercel
Copy link

vercel bot commented Mar 14, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated
drei ✅ Ready (Inspect) Visit Preview 💬 Add your feedback Mar 14, 2023 at 0:22AM (UTC)

@codesandbox-ci
Copy link

codesandbox-ci bot commented Mar 14, 2023

This pull request is automatically built and testable in CodeSandbox.

To see build info of the built libraries, click here or the icon next to each commit SHA.

Latest deployment of this branch, based on commit bfc762d:

Sandbox Source
zealous-goodall-ftwr5k Configuration
Ground reflections and video textures Configuration
arc-x-pmndrs-colors Configuration

src/core/Points.tsx Outdated Show resolved Hide resolved
Would be more correct since we're using the class' local transforms. The difference between the two lines is whether the ray should do the same or exist as a sibling of the same parent.
@drcmda
Copy link
Member

drcmda commented Mar 21, 2023

@promontis is this done?

@promontis
Copy link
Contributor Author

This version is better than the current version, so you might want to merge it in.

I'm currently running in a couple of problems with this code, namely:

  • points will disappear because the boundingBox/Sphere is not updated
  • when we zoom in (like x100), the raycast hits too wide

@CodyJasonBennett CodyJasonBennett merged commit 4b8d257 into pmndrs:master May 8, 2023
@github-actions
Copy link

github-actions bot commented May 8, 2023

🎉 This PR is included in version 9.66.5 🎉

The release is available on:

Your semantic-release bot 📦🚀

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants