Update: initially this post included details and questions regarding the behavior in the immersive-vr (webxr) session as well as the non-immersive “canvas on screen” mode. It was later repurposed to discuss just the set of questions/issues with SixDofDragBehavior
vs GLTF vs scene.useRightHandedSystem = true
. A separate post was created later to discuss immersive-vr specific stuff. Now to the original post:
In this playground I add separate instances of new SixDofDragBehavior()
to three meshes:
- a babylon native Box created at runtime,
- https://playground.babylonjs.com/scenes/BoomBox/BoomBox.gltf (along with …BoomBox/BoomBox.bin and other resources that references),
- a model in the GLB format that’s been created by one of the smartphone photogrammetry 3D scanning apps and then processed in blender a bit…
SixDofDragBehavior
exhibits different behavior with all three; it seems to work “perfectly” with the babylon native box, but not with the other two.
Can someone please help explain the behaviors I am seeing and give guidance on how to go about understanding and debugging stuff (and in particular SixDofDragBehavior
) with various GLTF/GLB models (with different structure of meshes, transform nodes, etc).
Note: I add SixDofDragBehavior
to the __root__
mesh of the imported models. Doing otherwise produced wild behaviors that I found even harder to explain… So I stopped trying that.
Here are the behaviors I am seeing.
- with the native babylon Box – things seem to work:
- dragging works as expected with the ray in the normal (not the immersive-vr) mode
- dragging works as expected with the ray in the immersive-vr mode
- near-dragging activates and works as expected in the immersive-vr mode
- with the
BoomBox.gltf
:- dragging works as expected with the ray in the normal mode
- dragging works as expected with the ray in the immersive-vr mode
- near-dragging does not activate/work in the immersive-vr mode even though
mesh.isNearGrabbable
is set totrue
as a result of adding theSixDofDragBehavior
- model in the GLB format:
- dragging almost works as expected with the ray in the normal mode: when grabbing the mesh to drag it, it first rotates 180 degrees (which is unexpected) and then dragging works fine until I release the mouse button
- in the immersive-vr dragging with a ray works the same as in the non-immersive mode: the mesh rotates 180 degrees at the beginning of each dragging
- near-dragging does not activate/work in the immersive-vr mode even though
mesh.isNearGrabbable === true
How can I explain (and then amend) the behaviors I highlighted with bold above?
I suspect that the structure/contents of the GLB file is a part of the explanation. As you can see, __root__
's only child is a transform node and that in turn has two more transform nodes (for whatever reason with such a simple model…) and only one of those has a mesh child:
but I still have little idea where to start looking for the specific bits that influence UX, and which of those can/should be fixed in the GLB/model internals and which might need to be fixed in
SixDofDragBehavior
…