I think chrome on android was caching too hard. I commented everything out except a console.log for all of the onPointerEnter etc events and they weren’t firing on mobile but after a re-export it finally updated on the phone
by user 103054507105067008
Trying to find where it swaps between the desktop version of the dragging and the XR version of dragging so I can stop that but I think I sorted that
by user 103054507105067008
Okay, so I went in and added the pointer events used, but commented out any logic to do with dragging except the addDragEventListener
which seems to overwrite anything if we are in XR it still makes the object movable with the camera when it shouldn’t move
by user 103054507105067008
Just confused me because I thought I commented out all the onDrag logic
by user 103054507105067008
Does it get swapped out into a different component when we enter XR? Even though it is a component I have made myself
by user 103054507105067008
marwie1
(marwi)
October 27, 2022, 12:00am
27
The drag controls component is still in the scene?
marwie1
(marwi)
October 27, 2022, 12:00am
28
Or do you replace it with your own?
All of the pointer events fire a console.log only but somehow dragging still works
by user 103054507105067008
marwie1
(marwi)
October 27, 2022, 12:00am
30
ah you might need to set canGrab
to false if you use the Interactable (you derive from it)
It’s my own component, the one I sent the script of above, no DragControls in the scene at all
by user 103054507105067008
Trying now, was confused because I took out any logic for dragging and just wanted to get the pointer events but the object was still draggable in AR while firing my console.logs
by user 103054507105067008
marwie1
(marwi)
October 27, 2022, 12:00am
33
As said - in AR the touches act like controllers by default.
Am I going the wrong route to doing AR pointer events I assume
by user 103054507105067008
Ok so canGrab being false sorted that
by user 103054507105067008
That’s perfect actually as I can use canGrab to switch out into your controller based grabbing if needed
by user 103054507105067008
I never heard back from @Adoran on this but today I am starting with an experiment of integrating Google’s Model Viewer into Needle for draggable AR placement https://modelviewer.dev/examples/augmentedreality/#webXR
by user 103054507105067008
I guess you mean integrating their camera controls specifically?
Would be these:
/* @license
* Copyright 2019 Google LLC. All Rights Reserved.
* Licensed under the Apache License, Version 2.0 (the 'License');
* you may not use this file except in compliance with the License.
* You may obtain a copy of the License at
*
* http://www.apache.org/licenses/LICENSE-2.0
*
* Unless required by applicable law or agreed to in writing, software
* distributed under the License is distributed on an 'AS IS' BASIS,
* WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
* See the License for the specific language governing permissions and
* limitations under the License.
*/
import {Event as ThreeEvent, EventDispatcher, Matrix4, PerspectiveCamera, Vector3, WebGLRenderer} from 'three';
import {XREstimatedLight} from 'three/examples/jsm/webxr/XREstimatedLight.js';
import {CameraChangeDetails, ControlsInterface} from '../features/controls.js';
import {$currentBackground, $currentEnvironmentMap} from '../features/environment.js';
This file has been truncated. show original
Yep, specifically the placement of the objects in AR with drag/scale/rotate pulling in through touches for simple AR product viewing
by user 103054507105067008
Thanks, going to start there
by user 103054507105067008