2017-02-27 22 views
0

在下面的場景中,我試圖理解爲什麼在點擊球體切換攝像機和光標(via.removeAttribute/.setAttribute)後仍然可以切換回even if I click outside the sphere - 即使場景檢查器沒有顯示光標或raycaster firstCursorEl導致鬼點擊事件。測試場景在http://codepen.io/anon/pen/GWJrXe,讓我知道如果我錯過了一些重要的東西! (jhsu提到如果.removeAttribute('cursor')被on-init調用,需要綁定render-target-loaded來等待加載的canvas元素,但是我假設不需要發生on-click。)什麼檢查員給出的實體HTML看起來像一個交換後,如果它可以幫助:Ghost raycaster在移除後仍然發送事件?

<a-entity print-onenter="" id="firstCursorEl" mixin="avatarCursor"></a-entity> 
<a-entity print-onenter="" mixin="avatarCursor" id="secondCursorEl" raycaster="" cursor=""></a-entity> 

哪裏firstCursorEl是入門級相機的孩子,secondCursorEl我們換到相機的孩子。既然secondCursorEl的光標/射線瞄準器遠離交換按鈕範圍(除非它們與攝像機注視方向有些不同步),並且firstCursorEl似乎沒有這樣的組件,它又如何交換?

回答

0

此問題已由Don McCurdy修復:https://github.com/aframevr/aframe/pull/2397來實現遊標移除處理程序。

您可以使用此版本:<script src="https://rawgit.com/aframevr/aframe/84c6431/dist/aframe-master.min.js"></script>將其拉入,直到0.5.1或0.6.0結束。

相關問題