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

vive-controls

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

The vive-controls component interfaces with the HTC Vive controllers/wands. It wraps the tracked-controls componentwhile adding button mappings, events, and a Vive controller model that highlights the pressed buttons (trigger, grip, menu, system) and trackpad.

Example

            
              <
                a-entity
                vive-controls=
                "hand: left">
              </
                a-entity>
            
              <
                a-entity
                vive-controls=
                "hand: right">
              </
                a-entity>
          

Value

PropertyDescriptionDefault Value
buttonColorButton colors when not pressed.#FAFAFA (off-white)
buttonHighlightColorButton colors when pressed and active.#22D1EE (light blue)
handThe hand that will be tracked (i.e., right, left).left
modelWhether the Vive controller model is loaded.true
rotationOffsetOffset to apply to model rotation.0

Events

Event NameDescription
gripdownGrip button pressed.
gripupGrip button released.
menudownMenu button pressed.
menuupMenu button released.
systemdownSystem button pressed.
systemupSystem button released.
trackpaddownTrackpad pressed.
trackpadupTrackpad released.
triggerdownTrigger pressed.
triggerupTrigger released.

Assets