Skip to content

Conversation

@Clicky02
Copy link
Contributor

Description: Fixes issue #4882

Changes proposed:

  • make unitLineEndVec3 in raycaster.js store the normalized direction instead of the normalized direction plus origin
  • make the raycaster's line's endpoint be equal to unitLineEndVec3 times the length plus the origin

@Clicky02 Clicky02 changed the title fix appearance of raycaster (fixes aframevr#4882) fix appearance of raycaster (fixes aframevr#4884) Jul 12, 2021
@Clicky02 Clicky02 changed the title fix appearance of raycaster (fixes aframevr#4884) fix appearance of raycaster (fixes aframevr#4882) Jul 12, 2021
Copy link

@mikemainguy mikemainguy left a comment

Choose a reason for hiding this comment

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

Can we get this into 1.4.2? This is more prominent in new release. I actually think only the second half is necessary (line 381). I tested just that change locally and it fixes the problem for me. I'm not sure about the changes on lines 104-106.

@mikemainguy
Copy link

mikemainguy commented Jan 13, 2023

raycaster.mp4

Attached example of problem @dmarcos can we merge?

@Clicky02
Copy link
Contributor Author

Can we get this into 1.4.2? This is more prominent in new release. I actually think only the second half is necessary (line 381). I tested just that change locally and it fixes the problem for me. I'm not sure about the changes on lines 104-106.

Just want to add that I'm pretty sure both changes are necessary to fully fix the issue. Just making the second the second change will make it look better in certain scenarios (i.e. when the origin is close to <0,0,0> or when the origin is displaced in the raycaster's direction), but it won't fix it in all cases.

I'd also definitely like to see this get merged. I brought up this bug initially because the raycaster for the controller I was using would be noticeably inaccurate whenever it started intersecting with something close to it, which looks like the same thing you're experiencing.

@dmarcos
Copy link
Member

dmarcos commented Jan 21, 2023

thanks!

@dmarcos dmarcos merged commit 3d8b725 into aframevr:master Jan 21, 2023
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.

3 participants