react-xr icon indicating copy to clipboard operation
react-xr copied to clipboard

usehittest not mapping a plane?

Open JakeJustLearning opened this issue 3 years ago • 1 comments

I have created hit test reticles with a flat ring in Three and webXR without React. One thing I am able to do by using the Matrix4 returned by the hit test is to lay a ring mesh flat on the physical surface. However when doing the same thing using the react-xr I am getting a hit test but it is not mapping the retticle flat to the plain.

ref.current.matrix.fromArray(hitMatrix.elements) is the callback I am using to map the hitMatrix objects Matrix4 to the ref's matrix. however it does seem to be getting the rotation of the plane. Is this have something to do with the XRHitTestOptions.entityTypes would I need to some how set this to be planes? if so how does one do this in react XR component?

JakeJustLearning avatar Sep 23 '21 11:09 JakeJustLearning

the desired hit test reticle behavior can be seen in this github pages example I made without react desired

and here is the react-xr it does not map to a plain but rather a point so that the rotation of the object is not changing in relation to the hittest

JakeJustLearning avatar Sep 24 '21 08:09 JakeJustLearning