Skip to content
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

DragControls: Add support for dragging a group object. #18623

Open
wants to merge 2 commits into
base: dev
from

Conversation

@Mugen87
Copy link
Collaborator

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

This comment has been minimized.

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

This comment has been minimized.

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 Mugen87 force-pushed the Mugen87:dev42 branch from 39fd37a to 6e03702 Feb 14, 2020
@Mugen87

This comment has been minimized.

Copy link
Collaborator Author

Mugen87 commented Feb 14, 2020

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

https://raw.githack.com/Mugen87/three.js/dev42/examples/misc_controls_drag.html

@Mugen87 Mugen87 force-pushed the Mugen87:dev42 branch from 13cec93 to eba1fd5 Feb 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Linked issues

Successfully merging this pull request may close these issues.

None yet

2 participants
You can’t perform that action at this time.