-
Notifications
You must be signed in to change notification settings - Fork 3.5k
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
Possible fix for possible scene.pickFromRay bug #7129
Conversation
Thank you so much for the pull request @sherousee! I noticed this is your first pull request and I wanted to say welcome to the Cesium community! The Pull Request Guidelines is a handy reference for making sure your PR gets accepted quickly, so make sure to skim that.
Reviewers, don't forget to make sure that:
I am a bot who helps you make Cesium awesome! Contributions to my configuration are welcome. 🌍 🌎 🌏 |
I wonder if the case here is Could you try removing the |
That could make sense, I will give it a shot. Thanks! |
@lilleyse Pulling this in from the cesium-dev mailing list where I was having a conversation with @OmarShehata : Ended up running into another issue after that. 'scene.pickFromRay()' will occasionally return undefined in cases where I know it should actually return a result. From what I can tell, I think the issue is in 'PickFramebuffer.prototype.end' either 'context.readPixels()' is not invoked correctly or the colors are not being indexed correctly from the 'pixels' object. Of course, I could be completely wrong. |
The picked position from A couple questions - is the portion of the tileset being picked on screen? And could you share the code that's calling If it helps to compare against something, there's a development demo using |
@lilleyse the picked position from Yes at the time of picking, the entire tileset is on screen: The code is pretty basic:
I'm using I am confident the ray calculation is correct because it is exactly the same calculation as I have been using to pick. Using my previous implementation for picking, after all of my data is loaded in the scene, I should have 17 points of intersection with the tileset. Using While debugging, I tried manually adjusting the ray direction slightly by adding 0.001 to each component of the ray just to see if there were 'holes' in my model that the correct ray passed directly through. This did have an effect. Some of intersections that were previously missing showed up, and some of the rays that previously showed up went missing. I am not sure exactly how to interpret this. I also don't know exactly how you've implemented the picking. From what I can tell, you are using a color based approach where each triangle/feature/something in the scene is assigned a unique color. The color of a feature is then used as an id. My instinct is that perhaps there are not enough unique ids that can be generated strictly using r,g,b,a for each feature in my tileset to receive a unique id. This would mean some of the features end up with the same id. But again, I really don't know! |
Yeah the tileset does have to be on screen for
Ah and I was mixing up a couple concepts. If Can you give |
@lilleyse Awesome, |
@sherousee given that the fix is also in #7115 I'm going to close this. Thanks! |
Sounds good! |
We encountered an error when testing
scene.pickFromRay()
.After calling
pickFromRay()
, the function returns with results, however the scene crashes. We've not been able to reproduce the bug using an unminified version of Cesium, but the exception isfunctions[i] is not a function
. Inspectingfunctions[i]
shows that it is undefined sometimes.This is a naive approach to fixing this problem, but it does appear to stop the scene from crashing.
@lilleyse