nathanidp Posted August 21, 2018 Share Posted August 21, 2018 For performance issues I'm working with instance of mesh in my current project. Currently to use highlight when i select a mesh with the pointer I disable the instance and clone the original mesh but only to use the highlightlayer. I call it the selectionMesh. However I also want to drag the selectionMesh by adding a pointerDragBehavior to it but the selection (and the creation of the SelectionMesh) starts when the pointer is down. What I want is when i click on the instance i create the selectionMesh, disable the instance, add the behavior to the mesh AND start the dragging. Currently I must click once to the instance to create the selectionMesh and then click another time to start the dragging which is not what I need. Any suggestion ? Quote Link to comment Share on other sites More sharing options...
Sebavan Posted August 21, 2018 Share Posted August 21, 2018 You can call startDrag() on the pointerDragBehavior. It is here to help you programmatically initiates a drag ? Quote Link to comment Share on other sites More sharing options...
Sebavan Posted August 21, 2018 Share Posted August 21, 2018 Press a to start a drag and s to release: http://playground.babylonjs.com/#9UFEBE#5 thanks @trevordev Quote Link to comment Share on other sites More sharing options...
nathanidp Posted August 21, 2018 Author Share Posted August 21, 2018 Thanks ! It seems great ! Quote Link to comment Share on other sites More sharing options...
nathanidp Posted August 21, 2018 Author Share Posted August 21, 2018 I have an error which says that startDrag is not a function. My current version is "babylonjs": "^3.3.0-alpha.15" Quote Link to comment Share on other sites More sharing options...
nathanidp Posted August 21, 2018 Author Share Posted August 21, 2018 Fixed, I needed to pass on "3.3.0-beta" Sebavan 1 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.