function render(timestamp, frame) {
const delta = clock.getDelta();
if (frame) {
const referenceSpace = renderer.xr.getReferenceSpace();
const session = renderer.xr.getSession();
if (hitTestSourceRequested === false) {
session
.requestReferenceSpace("viewer")
.then(function (referenceSpace) {
return session.requestHitTestSource({ space: referenceSpace });
})
.then(function (source) {
hitTestSource = source;
});
session.addEventListener("end", function () {
hitTestSourceRequested = false;
hitTestSource = null;
});
hitTestSourceRequested = true;
}
if (hitTestSource) {
const hitTestResults = frame.getHitTestResults(hitTestSource);
if ( hitTestResults.length ) {
const hit = hitTestResults[0];
reticle.visible = true;
reticle.matrix.fromArray(hit.getPose(referenceSpace).transform.matrix);
} else {
reticle.visible = false;
}
}
}
for (const mixer of mixers) mixer.update(delta);
if (mixer1) { mixer1.update(delta);}
renderer.render(scene, camera);
}
can some one help me with this ? i want to place the object once in hit test then i want to diable the reticle … so how can i will do it ?