bigrig
March 11, 2020, 11:43pm
1
Hi all. Am trying to get my BoundingBoxGizmo to tell me where it is. But onDragObservable not working (as I’d expect it to). Following instructions here: Use Gizmos (eg. Drag arrow, Bounding box) - Babylon.js Documentation
https://www.babylonjs-playground.com/#487FSE#3
Gizmo doesn’t seem to have a dragBehavior
, but it does have a pointerDragBehavior
… however, an observable attached to that doesn’t do anything.
Any ideas?
bigrig
March 11, 2020, 11:51pm
2
Well, figured out another way to do it:
var dragobserver = new BABYLON.PointerDragBehavior();
dragobserver.onDragObservable.add((event)=>{
console.log("drag",meshid);
console.log(event);
})
mesh.addBehavior(dragobserver);
It will be available in 10 minutes in preview.
Is there a solution for this? I am seeing the same behavior.
this.gizmoManager.boundingBoxDragBehavior.onDragStartObservable // Exists
this.gizmoManager.boundingBoxDragBehavior.onDragEndObservable // Exists
this.gizmoManager.boundingBoxDragBehavior.onDragObservable // Doesnt exist (can we add)
this.gizmoManager.gizmos.boundingBoxGizmo.pointerDragBehavior.onDragObservable // Exists but doesn’t work
it does not work in the pg cause another drag is added to the box
Hi Sebavan, thanks for the prompt response.
For my usecase I am using gizmoManager which uses the behavior:
public boundingBoxDragBehavior = new SixDofDragBehavior();
… Can we add onDragObservable
?
sebavan
October 21, 2020, 10:18pm
8
Thanks Sebavan, you’re the best!!