当前位置: 首页 > 文档资料 > A-Frame 中文文档 >

look-controls

优质
小牛编辑
148浏览
2023-12-01

The look-controls component:

  • Rotates the entity when we rotate a VR head-mounted display (HMD).
  • Rotates the entity when we click-drag mouse.
  • Rotates the entity when we touch-drag the touchscreen.

Example

The look-controls component is usually used alongside the camera component.

            
              <
                a-entity
                camera
                look-controls>
              </
                a-entity>
          

Properties

PropertyDescriptionDefault Value
enabledWhether look controls are enabled.true
hmdEnabledWhether to use VR headset pose in VR mode.true
reverseMouseDragWhether to reverse mouse drag.false
standingWhether standing mode is enabled (passed to THREE.VRControls).true

Caveats

If you want to create your own component for look controls, you will have to copy and paste the HMD-tracking bits into your component. In the future, we may have a system for people to more easily create their controls.