1.0.2 • Published 2 years ago

aframe-exokit-avatars v1.0.2

Weekly downloads
-
License
MIT
Repository
github
Last release
2 years ago

A-Frame Exokit Avatars

This A-Frame component provides an easy way to integrate a full-body IK avatar in WebXR through my fork of the Exokit Avatars system.

Usage

The following is the most basic scene setup that will load in an avatar:

<!DOCTYPE html>
<html>
  <head>
    <script src="https://aframe.io/releases/1.3.0/aframe.min.js"></script>
    <script src="../dist/aframe-exokit-avatars.min.js"></script>
    <title>A-Frame Exokit Avatars</title>
  </head>
  <body>
    <a-scene>
      <a-assets>
        <a-asset-item id="model" src="./dan.glb"></a-asset-item>
      </a-assets>
      <a-plane id="ground" rotation="-90 0 0" color="green" height="10" width="10"></a-plane>
      <a-light type="directional" intensity="0.5"></a-light>
      <a-light type="ambient" intensity="0.5"></a-light>
      <a-sky color="blue"></a-sky>
      <a-entity avatar="model: #model"></a-entity>
      <a-entity id="player">
        <a-camera id="head" near="0.1" wasd-controls look-controls></a-camera>
        <a-entity id="leftHand" tracked-controls="hand: left"></a-entity>
        <a-entity id="rightHand" tracked-controls="hand: right"></a-entity>
      </a-entity>
    </a-scene>
  </body>
</html>

Considerations

  • If implementing some form of touchpad or thumbstick movement, ensure your avatar is not parented under the player/camera rig object, as this will prevent the leg IK from functioning properly.
  • By default, the tracked-controls component in A-Frame reports controller pose based on target ray space by default instead of grip space (refer to the WebXR Device API for more details). It's more than likely there might be some noticeable offset in the hand positions from where your controllers are. There is currently an open PR to let grip space be used for pose reporting, but in the meantime you may want to apply some manual offset to your controller pose to compensate.

Schema

PropertyTypeDescriptionDefault Value
modelmodelA selector or path to an avatar model
playerselectorAn element representing the player/camera rig#player
headselectorAn element representing the main camera of the scene#head
leftHandselectorAn element representing the tracked left hand#leftHand
rightHandselectorAn element representing the tracked right hand#rightHand
fingersboolWhether or not to animate finger poses (point, grip)true
hairboolWhether or not to animate hairtrue
decapitateboolWhether or not to remove the head of the modelfalse
visemesboolWhether or not to animate visemes on the model (mouth, blinking)true
mutedboolWhether or not to passthrough mic audio into the page.true
debugboolWhether or not to render debug meshes.false
1.0.2

2 years ago

1.0.1

2 years ago

1.0.0

2 years ago