-
Notifications
You must be signed in to change notification settings - Fork 217
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
Adding GVRPicker.pickVisible #765
Conversation
The picker internally has access to the list of visible objects compiled by the renderer each frame. This
The picker internally has access to the list of visible objects compiled by the renderer each frame. This
…nto pickvisible
I assumed that we were planning to move away from the polling model proposed in this change to an event based model for picking. If we were to implement this change to fit the events model then it would make sense to create a new type of picker like a box or frustum picker to the camera rig to listen for IPickEvents. |
first cut at picking events for view frustum. this version just picks to the scene's main camera view frustum. picking to an arbitrary frustum is not working yet.
OK I added GVRFrustumPicker which will generate the same pick events as GVRPicker |
👍 Looks good. Tried this with the eye picking sample, changed the GVRPicker to GVRFrustumPicker to test. |
GVRPicker worked correctly when attached to the camera but not when attached to a scene object. To fix this bug I changed the native picker to use world coordinates instead of camera coordinates for the ray. This allows any scene object to become the origin of the ray more easily. GVRSphereCollider was not honoring the setRadius value so I fixed that. I added support to GVRFrustumPicker for a user-defined frustum, not just the current camera.
dir.mul(view_matrix); | ||
if (!mCuller.isSphereInsideFrustum(center.x, center.y, center.z, dir.length())) | ||
{ | ||
Log.d("Picker", "Picker: outside %s (%f, %f, %f) %f", sceneObj.getName(), center.x, center.y, center.z, dir.length()); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should remove the logging. Can be done later of course.
Should we document that probably people want to add the component to |
If I modify the eye-picking sample accordingly and use |
Looks good. Will merge Thursday afternoon if there are no further comments. |
setFrustum(90, 1, near, far) should show all the bunnies as red. If that is not happening it is a bug. I will look at it. |
GVRCameraRig.getHeadTransformObject is protected. I will make it public. That is the accessor for the head transform owner object. |
The picker internally has access to the list of visible objects compiled
by the renderer each frame. This function provides access to that list from Java.
This feature is added in response to issue #762
GearVRf-DCO-1.0-Signed-off-by: Nola Donato nola.donat@samsung.com