msub2 / aframe-exokit-avatars

A wrapper for the Exokit Avatars system in an A-Frame component.
https://msub2.github.io/aframe-exokit-avatars/examples/
MIT License
19 stars 6 forks source link
avatar avatars exokit vr webxr

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="https://cdn.jsdelivr.net/npm/aframe-exokit-avatars@1.0.2"></script>
    <title>A-Frame Exokit Avatars</title>
  </head>
  <body>
    <a-scene>
      <a-assets>
        <a-asset-item id="model" src="https://github.com/msub2/aframe-exokit-avatars/raw/main/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

Schema

Property Type Description Default Value
model model A selector or path to an avatar model
thirdPerson boolean Whether this is an avatar for a different player than the user false
player selector An element representing the player/camera rig #player
head selector An element representing the main camera of the scene #head
leftHand selector An element representing the tracked left hand #leftHand
rightHand selector An element representing the tracked right hand #rightHand
fingers bool Whether or not to animate finger poses (point, grip) true
hair bool Whether or not to animate hair true
decapitate bool Whether or not to remove the head of the model false
visemes bool Whether or not to animate visemes on the model (mouth, blinking) true
muted bool Whether or not to passthrough mic audio into the page. true
debug bool Whether or not to render debug meshes. false