Skip to content

Conversation

@Mugen87
Copy link
Collaborator

@Mugen87 Mugen87 commented Feb 13, 2020

This PR adds a small enhancement to DragControls. It allows users to drag a group instead of the individual 3D objects. I've seen this feature request multiple times in the past and I thought it's a good addition to the controls (e.g. https://discourse.threejs.org/t/dragcontrol-for-a-group-object/12645).

The idea is to expose the array of draggable objects and introduce a new boolean property that enables the new behavior. I've enhanced webgl_loader_3mf_materials to shows this new feature. It's now possible to drag the entire truck and not its individual parts.

@mrdoob
Copy link
Owner

mrdoob commented Feb 14, 2020

I think the example is confusing.

What about adding something like "shift+click" to add to the selection in this example?

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Feb 14, 2020

What about adding something like "shift+click" to add to the selection in this example?

You're right, that makes the handling more clear. Let me update the PR...

@Mugen87
Copy link
Collaborator Author

Mugen87 commented Feb 14, 2020

Okay, I've enhanced misc_controls_drag and refactored my initial code a bit.

@mrdoob
Copy link
Owner

mrdoob commented Feb 21, 2020

Much nicer!
I think it's just missing Shift+Click to deselect too. So Shift+Click toggles.

@mrdoob mrdoob added this to the r114 milestone Feb 21, 2020
@Mugen87
Copy link
Collaborator Author

Mugen87 commented Feb 22, 2020

Done! Also clarified the description at the header.

@mrdoob mrdoob merged commit 5c959da into mrdoob:dev Feb 22, 2020
@mrdoob
Copy link
Owner

mrdoob commented Feb 22, 2020

Thanks!

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.

2 participants