-
Notifications
You must be signed in to change notification settings - Fork 85
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
Pick Multiple object, drag and drop them. #7
Comments
Hi @ignacio-chiazzo, any idea how we can achieve this? |
I need this too. |
That's something that I plan to tackle soon, but feel free to open a PR if you want to :) |
Give a hint please? What functions handles all this? |
@KMamedoff We track the last object tapped/selected in the You need to have the instance of the |
Can we not make it without arrays? Can we use hitTest? |
You can use hitTest, you would have to compare that the object hit is a VirtualObject like this ARKit/ARKitProject/UI Elements/Gesture.swift Lines 117 to 125 in b72301f
|
Okay but how can I make that "result" node the selected virtual object? Can you show that to me please? I would really appreciate your help. |
You have to use an array to track the objects you have placed, like I said above. When the user clicks on the screen you get the result from hitTest and you compare that the
|
I get what you saying. I am asking a different approach to the issue. Can we assign current tapped node to current virtualObject variable? That way we would not need arrays. |
No that I can think of, but I didn't try it. |
Can you help me with arrays please? Can you add arrays to the source code? I cannot figure it out. |
Thanks for taking a look at this. I'm glad you have the interest to add this feature :). I cannot work on this for at least two weeks, but I can help you as much as I can. |
@KMamedoff I added this PR that will make things easier to tackle this issue. That PR adds a new class Manager which stores the objects that have been placed on the plane. In addition, that PR adds a unique ID to all virtual Objects so as to make easier to detect which object was selected. So now, when the user touched the screen we can detect whether the user selected an object and which object was selected (by comparing the ids) |
We only can drag and drop the last object selected. We want to allow dragging and dropping to all object placed regardless the time they were added.
The text was updated successfully, but these errors were encountered: