Created
March 9, 2020 06:13
-
-
Save makihiro/587d9b2a6ffd16db80c148d484d2426d to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
//L198-211,onXRFrame内 | |
if (xrHitTestSource && pose) { | |
let hitTestResults = frame.getHitTestResults(xrHitTestSource); | |
if (hitTestResults.length > 0) { | |
//hit testを行い、hit testの結果が得られたら、バーチャルオブジェクト(reticle)を可視にセットする処理。表示位置はpose情報から取得 | |
let pose = hitTestResults[0].getPose(xrRefSpace); | |
reticle.visible = true; | |
reticle.matrix = pose.transform.matrix; | |
} | |
} | |
scene.drawXRFrame(frame, pose); //フレームを描画 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment