<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "https://www.web3d.org/specifications/x3d-3.0.dtd">
<X3D profile='Immersive' version='3.0' xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation='https://www.web3d.org/specifications/x3d-3.0.xsd'>
  <head>
    <meta content='ViewPositionOrientationHUD.x3d' name='title'/>
    <meta content='ViewPositionOrientation Heads-Up Display (HUD) to show position and orientation on screen. Drag to move, click text to toggle console trace. Used as an Inline node, assumes local coordinate system where invoked.' name='description'/>
    <meta content='Don Brutzman' name='creator'/>
    <meta content='13 June 2004' name='created'/>
    <meta content='28 November 2019' name='modified'/>
    <meta content='https://www.web3d.org/x3d/content/examples/Savage/Tools/HeadsUpDisplays/ViewPositionOrientationHUD.x3d' name='identifier'/>
    <meta content='X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit' name='generator'/>
    <meta content='../../license.html' name='license'/>
  </head>
  <Scene>
    <WorldInfo title='ViewPositionOrientationHUD.x3d'/>
    <ExternProtoDeclare name='HeadsUpDisplay' url='"../../../X3dForWebAuthors/Chapter14Prototypes/HeadsUpDisplayPrototype.x3d#HeadsUpDisplay" "https://www.web3d.org/x3d/content/examples/Savage/Tools/HeadsUpDisplays/HeadsUpDisplayPrototype.x3d#HeadsUpDisplay" "../../../X3dForWebAuthors/Chapter14Prototypes/HeadsUpDisplayPrototype.wrl#HeadsUpDisplay" "https://www.web3d.org/x3d/content/examples/Savage/Tools/HeadsUpDisplays/HeadsUpDisplayPrototype.wrl#HeadsUpDisplay"'>
      <field accessType='inputOutput' appinfo='Displayed subscene positioned as a HUD.' name='children' type='MFNode'/>
      <field accessType='inputOutput' appinfo='Additional HUD geometry which can be touched and dragged for repositioning. If this geometry goes offscreen (perhaps due to screen resizing) then it snaps back to original position.' name='dragChildren' type='MFNode'/>
      <field accessType='initializeOnly' appinfo='Modified screen location and distance (for size).' name='locationOffset' type='SFVec3f'/>
      <field accessType='initializeOnly' appinfo='Enable/disable console output for troubleshooting.' name='traceEnabled' type='SFBool'/>
    </ExternProtoDeclare>
    <ExternProtoDeclare appinfo='ViewPositionOrientation prototype provides local position and orientation as user navigates with optional console output' name='ViewPositionOrientation' url='"../../../Savage/Tools/Authoring/ViewPositionOrientationPrototype.x3d#ViewPositionOrientation" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/ViewPositionOrientationPrototype.x3d#ViewPositionOrientation" "../../../Savage/Tools/Authoring/ViewPositionOrientationPrototype.wrl#ViewPositionOrientation" "https://www.web3d.org/x3d/content/examples/Savage/Tools/Authoring/ViewPositionOrientationPrototype.wrl#ViewPositionOrientation"'>
      <field accessType='inputOutput' appinfo='Whether or not ViewPositionOrientation sends output to console.' name='enabled' type='SFBool'/>
      <field accessType='initializeOnly' appinfo='Output internal trace messages for debugging this node - developer use only can be ignored.' name='traceEnabled' type='SFBool'/>
      <field accessType='inputOnly' appinfo='Ability to turn output tracing on/off at runtime.' name='set_traceEnabled' type='SFBool'/>
      <field accessType='outputOnly' appinfo='Output local position.' name='position_changed' type='SFVec3f'/>
      <field accessType='outputOnly' appinfo='Output local orientation.' name='orientation_changed' type='SFRotation'/>
      <field accessType='outputOnly' appinfo='MFString value of new Viewpoint for example: &lt;Viewpoint position="20 15 20" orientation="-0.516 0.83 0.212 0.9195"/>' name='outputViewpointString' type='MFString'/>
    </ExternProtoDeclare>
    <!-- ==================== -->
    <ProtoInstance name='HeadsUpDisplay'>
      <fieldValue name='children'>
        <Group>
          <Shape>
            <Appearance>
              <Material diffuseColor='0 1 1' emissiveColor='0 0.1 0.1'/>
            </Appearance>
            <Text DEF='DisplayText' string='"ViewPositionOrientationHUD"'>
              <FontStyle justify='"MIDDLE" "MIDDLE"' size='0.4'/>
            </Text>
          </Shape>
          <TouchSensor DEF='TraceToggleTouchSensor' description='toggle console trace'/>
          <BooleanToggle DEF='TraceToggle'/>
        </Group>
      </fieldValue>
      <fieldValue name='dragChildren'>
        <Transform translation='0 -0.1 -0.1'>
          <Shape>
            <Box size='11 0.45 0.001'/>
            <Appearance>
              <Material diffuseColor='1 1 1' transparency='0.95'/>
            </Appearance>
          </Shape>
        </Transform>
      </fieldValue>
      <fieldValue name='locationOffset' value='0 -3 0'/>
    </ProtoInstance>
    <ProtoInstance DEF='VPO' name='ViewPositionOrientation'>
      <fieldValue name='enabled' value='true'/>
      <fieldValue name='traceEnabled' value='false'/>
    </ProtoInstance>
    <ROUTE fromField='outputViewpointString' fromNode='VPO' toField='string' toNode='DisplayText'/>
    <ROUTE fromField='isActive' fromNode='TraceToggleTouchSensor' toField='set_boolean' toNode='TraceToggle'/>
    <ROUTE fromField='toggle_changed' fromNode='TraceToggle' toField='set_traceEnabled' toNode='VPO'/>
  </Scene>
</X3D>