WebXR teleporting while holding an object via bounding box gizmo (six DOF drag behavior) sends it flying off into the distance

Hey @RaananW, I have an issue where if I teleport while “holding” a mesh (grabbing a bounding box gizmo via WebXRControllerPointerSelection), the mesh zooms way off into the distance.

I suspect this is related to the feature where if you push a grabbed object away from you it moves a distance that is proportionally greater than the distance the controller moves, which I think is part of WebXRControllerPointerSelection.

Is is possible to disable that enhanced movement and just use 1:1 controller:object movement instead?

Update: okay it’s not in WebXRControllerPointerSelection, looks like maybe SixDofDragBehavior.zDragFactor which is private with no setter :frowning:

Update 2: For the record, this was resolved by changing two parameters on SixDofDragBehavior

// make object movement equal to controller movement
zDragFactor = 0
// disable the lerping so it doesn't lag behind when you teleport
dragDeltaRatio = 1
1 Like

Was just about to say that we don’t have that in the pointer selection feature :slight_smile:

Wil making this variable public solve the issue on your end?

I ended up extending the class so I could change the variable, but I think making it public or settable would be a great addition to the API

1 Like

I don’t see why not…

expose zDragFactor in SixDofDragBehavior by RaananW · Pull Request #10159 · BabylonJS/Babylon.js (github.com)

2 Likes