-
-
Notifications
You must be signed in to change notification settings - Fork 21.2k
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
Hardcoded maximum ray distance when Viewport
processes 3d object picking
#49735
Closed
Tracked by
#39876
Labels
Milestone
Comments
Flarkk
changed the title
Hardcoded maximum ray distance when viewport processes object picking
Hardcoded maximum ray distance when viewport processes 3d object picking
Jun 19, 2021
Flarkk
changed the title
Hardcoded maximum ray distance when viewport processes 3d object picking
Hardcoded maximum ray distance when Jun 19, 2021
Viewport
processes 3d object picking
Realizing that some others arguments of They probably need to be either turned into |
S0yKaf
added a commit
to S0yKaf/godot
that referenced
this issue
Oct 29, 2021
having the raycast distance hardcoded to `10000` caused input events to not be registered in very large 3D scenes. This resolves the issue by using the cameras far distance instead. Creating the more predictable behavior of if an object is visible, it will be picked by the viewport. resolves: godotengine#49735
S0yKaf
added a commit
to S0yKaf/godot
that referenced
this issue
Oct 29, 2021
having the raycast distance hardcoded to `10000` caused input events to not be registered in very large 3D scenes. This resolves the issue by using the cameras far distance instead. Creating the more predictable behavior of if an object is visible, it will be picked by the viewport. resolves: godotengine#49735
Here are some videos just to show the issue in action. Current Behaviorold.mp4Fix in #54369fix.mp4 |
akien-mga
pushed a commit
to akien-mga/godot
that referenced
this issue
Nov 15, 2021
having the raycast distance hardcoded to `10000` caused input events to not be registered in very large 3D scenes. This resolves the issue by using the cameras far distance instead. Creating the more predictable behavior of if an object is visible, it will be picked by the viewport. resolves: godotengine#49735 (cherry picked from commit 02b6bbc)
lekoder
pushed a commit
to KoderaSoftwareUnlimited/godot
that referenced
this issue
Dec 18, 2021
having the raycast distance hardcoded to `10000` caused input events to not be registered in very large 3D scenes. This resolves the issue by using the cameras far distance instead. Creating the more predictable behavior of if an object is visible, it will be picked by the viewport. resolves: godotengine#49735 (cherry picked from commit 02b6bbc)
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Godot version
4.0 dev 8b692e8 + all 3.x
System information
n/a
Issue description
When processing its physic 3d picking events,
Viewport
s cast rays from camera's origin to 10000 units ahead from it.The 10000 is harcoded in
Viewport::_process_picking()
when callingPhysicsDirectSpaceState3D::intersect_ray()
as following :intersect_ray(from, from + dir * 10000, [...] );
(see the actual code here)This does not allow object picking in arbitrary large scenes using the built-in
Viewport
's event handling capabilities.A possible workaround would be not to rely on the built-in
Viewport
's event handling capabilities but instead casting rays manually with a custom 'to' distance. This however makes user interaction handling much more cumbersome.Here are the few possibles ways of fixing it that immediately come to my mind :
Viewport
s allowing setting a custom maximum distancePhysicsDirectSpaceState3D
a method to check ray intersection without any maximum distance, and use it inViewport
's picking events processingI think the point of view of experienced Godot contributors is required here to select the most suitable fix regarding Godot design philosophy.
Steps to reproduce
Obvious from code reading
Minimal reproduction project
No response
The text was updated successfully, but these errors were encountered: