<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
<X3D profile='Immersive' version='3.3' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.3.xsd'>
  <head>
    <!-- Originally these fundamental prototypes were defined in InterchangableActorsViaDynamicRoutingPrototypes.x3d -->
    <meta content='HAnimPrototypes.x3d' name='title'/>
    <meta content='Example implementation of X3D Humanoid Animation (HAnim) nodes using X3D prototypes.' name='description'/>
    <meta content='These are developmental examples that can assist X3D player implementations and support interoperability. They are not intended for author use in regular X3D scenes.' name='warning'/>
    <meta content='Developer note: names for these HAnim Prototypes need to be corrected if used internally in an X3D player implementation (e.g. Joint to HAnimJoint).' name='warning'/>
    <meta content='Need support for skin' name='warning'/>
    <meta content='Ozan APAYDIN, Don Brutzman' name='creator'/>
    <meta content='Ozan APAYDIN, Don Brutzman' name='translator'/>
    <meta content='15 November 2001' name='created'/>
    <meta content='23 May 2020' name='modified'/>
    <meta content='upgrade to match support requirements for HAnim 2.2' name='TODO'/>
    <meta content='https://www.web3d.org/files/specifications/19774/V1.0/HAnim/HAnim.html' name='reference'/>
    <meta content='https://www.web3d.org/files/specifications/19775-1/V3.3/Part01/components/hanim.html' name='reference'/>
    <meta content='http://HAnim.org/Models/HAnim2001/boxman/boxman.wrl' name='reference'/>
    <meta content='http://HAnim.org/Specifications/HAnim2001' name='reference'/>
    <meta content='http://www.HAnim.org' name='reference'/>
    <meta content='http://HAnim.org/Models' name='reference'/>
    <meta content='http://HAnim.org/Specifications' name='reference'/>
    <meta content='InterchangableActorsViaDynamicRoutingPrototypes.x3d' name='reference'/>
    <meta content='https://www.web3d.org/x3d/content/examples/HumanoidAnimation/Prototypes/HAnimPrototypes.x3d' name='identifier'/>
    <meta content='X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit' name='generator'/>
    <meta content='../license.html' name='license'/>
  </head>
  <Scene>
    <!-- **********Human Model Protypes********* -->
    <ProtoDeclare appinfo='The Humanoid node serves as overall container for the Joint Segment Site and Viewpoint nodes which define the skeleton geometry and landmarks of the humanoid figure. Additionally the node provides a means for defining information about the author copyright and usage restrictions of the model.' documentation='http://HAnim.org/Specifications/HAnim2001/part1/Humanoid.html' name='Humanoid1_1'>
      <ProtoInterface>
        <!-- HAnim v1.1 field definitions -->
        <field accessType='inputOutput' name='name' type='SFString'/>
        <field accessType='inputOutput' appinfo='legal values: 1.1 or 2.0' name='version' type='SFString' value='1.1'/>
        <field accessType='inputOutput' appinfo='Version of the humanoid being modeled. Hint: HAnim version 2.0' name='humanoidVersion' type='SFString'/>
        <field accessType='inputOutput' name='info' type='MFString'/>
        <field accessType='inputOutput' name='translation' type='SFVec3f' value='0 0 0'/>
        <field accessType='inputOutput' name='rotation' type='SFRotation' value='0 0 1 0'/>
        <field accessType='inputOutput' name='center' type='SFVec3f' value='0 0 0'/>
        <field accessType='inputOutput' name='scale' type='SFVec3f' value='1 1 1'/>
        <field accessType='inputOutput' name='scaleOrientation' type='SFRotation' value='0 0 1 0'/>
        <field accessType='initializeOnly' name='bboxCenter' type='SFVec3f' value='0 0 0'/>
        <field accessType='initializeOnly' name='bboxSize' type='SFVec3f' value='-1 -1 -1'/>
        <field accessType='inputOutput' appinfo='HAnim 1.1 field container for body head. Hint: replaced by 2.0 skeleton.' documentation='http://HAnim.org/Specifications/HAnim1.1/#humanoid' name='humanoidBody' type='MFNode'/>
        <field accessType='inputOutput' appinfo='HAnim 2.0 field container for body geometry Hint: replaces 1.1 humanoidBody' documentation='http://HAnim.org/Specifications/HAnim2001/part1/Humanoid.html' name='skeleton' type='MFNode'/>
        <field accessType='inputOutput' appinfo='Container field for Joint nodes' name='joints' type='MFNode'/>
        <field accessType='inputOutput' appinfo='Container field for Segment nodes' name='segments' type='MFNode'/>
        <field accessType='inputOutput' appinfo='Container field for Site nodes' name='sites' type='MFNode'/>
        <field accessType='inputOutput' appinfo='Container field for Viewpoint nodes' name='viewpoints' type='MFNode'/>
        <field accessType='inputOutput' appinfo='Hint: HAnim version 2.0' name='skinCoord' type='SFNode'>
          <!-- NULL -->
        </field>
        <field accessType='inputOutput' appinfo='Hint: HAnim version 2.0' name='skinNormal' type='SFNode'>
          <!-- NULL -->
        </field>
      </ProtoInterface>
      <ProtoBody>
        <Transform DEF='HumanoidTransform'>
          <IS>
            <connect nodeField='translation' protoField='translation'/>
            <connect nodeField='rotation' protoField='rotation'/>
            <connect nodeField='center' protoField='center'/>
            <connect nodeField='scale' protoField='scale'/>
            <connect nodeField='scaleOrientation' protoField='scaleOrientation'/>
            <connect nodeField='bboxCenter' protoField='bboxCenter'/>
            <connect nodeField='bboxSize' protoField='bboxSize'/>
          </IS>
          <Group DEF='HumanoidGroup1'>
            <IS>
              <connect nodeField='children' protoField='humanoidBody'/>
            </IS>
          </Group>
          <Group DEF='HumanoidGroup2'>
            <IS>
              <connect nodeField='children' protoField='skeleton'/>
            </IS>
          </Group>
          <Group DEF='HumanoidGroup3'>
            <IS>
              <connect nodeField='children' protoField='viewpoints'/>
            </IS>
          </Group>
        </Transform>
      </ProtoBody>
    </ProtoDeclare>
    <ProtoDeclare appinfo='The Joint node is used as a building block to describe the articulations of the humanoid figure. Each articulation of the humanoid figure is represented by a Joint node each of which is organized into a hierarchy that describes the overall skeleton of the humanoid.' documentation='http://HAnim.org/Specifications/HAnim2001/part1/Joint.html' name='Joint'>
      <ProtoInterface>
        <field accessType='inputOutput' name='name' type='SFString'/>
        <field accessType='inputOutput' name='ulimit' type='MFFloat'/>
        <field accessType='inputOutput' name='llimit' type='MFFloat'/>
        <field accessType='inputOutput' name='limitOrientation' type='SFRotation' value='0 0 1 0'/>
        <field accessType='inputOutput' name='skinCoordIndex' type='MFInt32'/>
        <field accessType='inputOutput' name='skinCoordWeight' type='MFFloat'/>
        <field accessType='inputOutput' name='stiffness' type='MFFloat' value='0 0 0'/>
        <field accessType='inputOutput' name='translation' type='SFVec3f' value='0 0 0'/>
        <field accessType='inputOutput' name='rotation' type='SFRotation' value='0 0 1 0'/>
        <field accessType='inputOutput' name='scale' type='SFVec3f' value='1 1 1'/>
        <field accessType='inputOutput' name='scaleOrientation' type='SFRotation' value='0 0 1 0'/>
        <field accessType='inputOutput' name='center' type='SFVec3f' value='0 0 0'/>
        <field accessType='initializeOnly' name='bboxCenter' type='SFVec3f' value='0 0 0'/>
        <field accessType='initializeOnly' name='bboxSize' type='SFVec3f' value='-1 -1 -1'/>
        <field accessType='inputOutput' name='children' type='MFNode'/>
        <field accessType='inputOnly' name='addChildren' type='MFNode'/>
        <field accessType='inputOnly' name='removeChildren' type='MFNode'/>
      </ProtoInterface>
      <ProtoBody>
        <Transform DEF='JointTransform'>
          <IS>
            <connect nodeField='translation' protoField='translation'/>
            <connect nodeField='rotation' protoField='rotation'/>
            <connect nodeField='center' protoField='center'/>
            <connect nodeField='scale' protoField='scale'/>
            <connect nodeField='scaleOrientation' protoField='scaleOrientation'/>
            <connect nodeField='bboxCenter' protoField='bboxCenter'/>
            <connect nodeField='bboxSize' protoField='bboxSize'/>
            <connect nodeField='children' protoField='children'/>
            <connect nodeField='addChildren' protoField='addChildren'/>
            <connect nodeField='removeChildren' protoField='removeChildren'/>
          </IS>
        </Transform>
      </ProtoBody>
    </ProtoDeclare>
    <ProtoDeclare appinfo='The Segment node is used describe the attributes of the physical links between the joints of the humanoid figure. Each body part (pelvis thigh calf etc.) of the humanoid figure is represented by a Segment node.' documentation='http://HAnim.org/Specifications/HAnim2001/part1/Segment.html' name='Segment'>
      <ProtoInterface>
        <field accessType='inputOutput' name='name' type='SFString'/>
        <field accessType='inputOutput' name='mass' type='SFFloat' value='0'/>
        <field accessType='inputOutput' name='centerOfMass' type='SFVec3f' value='0 0 0'/>
        <field accessType='inputOutput' name='momentsOfInertia' type='MFFloat' value='0 0 0 0 0 0 0 0 0'/>
        <field accessType='initializeOnly' name='bboxCenter' type='SFVec3f' value='0 0 0'/>
        <field accessType='initializeOnly' name='bboxSize' type='SFVec3f' value='-1 -1 -1'/>
        <field accessType='inputOutput' name='children' type='MFNode'/>
        <field accessType='inputOnly' name='addChildren' type='MFNode'/>
        <field accessType='inputOnly' name='removeChildren' type='MFNode'/>
        <field accessType='inputOutput' appinfo='contains Coordinate nodes' name='coord' type='SFNode'>
          <!-- NULL -->
        </field>
        <field accessType='inputOutput' appinfo='contains Displacer nodes' name='displacers' type='MFNode'/>
      </ProtoInterface>
      <ProtoBody>
        <Group DEF='SegmentGroup'>
          <IS>
            <connect nodeField='bboxCenter' protoField='bboxCenter'/>
            <connect nodeField='bboxSize' protoField='bboxSize'/>
            <connect nodeField='children' protoField='children'/>
            <connect nodeField='addChildren' protoField='addChildren'/>
            <connect nodeField='removeChildren' protoField='removeChildren'/>
          </IS>
        </Group>
      </ProtoBody>
    </ProtoDeclare>
    <ProtoDeclare appinfo='The Site node can be used for three purposes: (a) to define an "end effector" location which can be used by an inverse kinematics system (b) to define an attachment point for accessories such as jewelry and clothing and (c) to define a location for a virtual camera in the reference frame of a Segment node (such as a view "through the eyes" of the humanoid for use in multi-user worlds).' documentation='http://HAnim.org/Specifications/HAnim2001/part1/Site.html' name='Site'>
      <ProtoInterface>
        <field accessType='inputOutput' name='name' type='SFString'/>
        <field accessType='inputOutput' name='translation' type='SFVec3f' value='0 0 0'/>
        <field accessType='inputOutput' name='rotation' type='SFRotation' value='0 0 1 0'/>
        <field accessType='inputOutput' name='scale' type='SFVec3f' value='1 1 1'/>
        <field accessType='inputOutput' name='scaleOrientation' type='SFRotation' value='0 0 1 0'/>
        <field accessType='inputOutput' name='center' type='SFVec3f' value='0 0 0'/>
        <field accessType='initializeOnly' name='bboxCenter' type='SFVec3f' value='0 0 0'/>
        <field accessType='initializeOnly' name='bboxSize' type='SFVec3f' value='-1 -1 -1'/>
        <field accessType='inputOutput' name='children' type='MFNode'/>
        <field accessType='inputOnly' name='addChildren' type='MFNode'/>
        <field accessType='inputOnly' name='removeChildren' type='MFNode'/>
      </ProtoInterface>
      <ProtoBody>
        <Transform DEF='SiteTransform'>
          <IS>
            <connect nodeField='translation' protoField='translation'/>
            <connect nodeField='rotation' protoField='rotation'/>
            <connect nodeField='center' protoField='center'/>
            <connect nodeField='scale' protoField='scale'/>
            <connect nodeField='scaleOrientation' protoField='scaleOrientation'/>
            <connect nodeField='bboxCenter' protoField='bboxCenter'/>
            <connect nodeField='bboxSize' protoField='bboxSize'/>
            <connect nodeField='children' protoField='children'/>
            <connect nodeField='addChildren' protoField='addChildren'/>
            <connect nodeField='removeChildren' protoField='removeChildren'/>
          </IS>
        </Transform>
      </ProtoBody>
    </ProtoDeclare>
    <ProtoDeclare appinfo='A Displacer can be used in three different ways: (a) identify the vertices corresponding to a particular feature on a Segment (b) represent a particular muscular action which displaces the vertices in various directions (linearly or radially) and (c) represent a complete configuration of the vertices in a Segment.' documentation='http://HAnim.org/Specifications/HAnim2001/part1/Displacer.html' name='Displacer'>
      <ProtoInterface>
        <field accessType='inputOutput' name='name' type='SFString'/>
        <field accessType='inputOutput' name='coordIndex' type='MFInt32'/>
        <field accessType='inputOutput' name='displacements' type='MFVec3f'/>
      </ProtoInterface>
      <ProtoBody>
        <WorldInfo info='"null body node"'/>
      </ProtoBody>
    </ProtoDeclare>
    <Shape>
      <Text string='"Humanoid Animation" "(HAnim) prototype" "implementations"'>
        <FontStyle justify='"MIDDLE" "MIDDLE"'/>
      </Text>
      <Appearance>
        <Material ambientIntensity='0.25' diffuseColor='0.7959 0.5059 0.0933' shininess='0.39' specularColor='0.9235 0.4289 0.0064'>
          <!-- Universal Media Library: Autumn 9 -->
        </Material>
      </Appearance>
    </Shape>
  </Scene>
</X3D>