<?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='AriesPrototype.x3d' name='title'/>
    <meta content='Model of the Acoustic Radio Interactive Exploratory Server (ARIES), an operational NPS-designed Unmanned Underwater Vehicle (AUV). Expose position, rotation, sonars, thrusters, fins, etc. as a reusable prototype.' name='description'/>
    <meta content='Don Brutzman NPS, aboard RV Gyre in Gulf of Mexico off Gulfport MS 1999; Jane Wu Rolands and Associates 2001, Duane Davis NPS 2003' name='creator'/>
    <meta content='30 July 2000' name='created'/>
    <meta content='20 October 2019' name='modified'/>
    <meta content='AriesHoistCloseup.jpg' name='photo'/>
    <meta content='AriesFlyerMarch2001.pdf' name='reference'/>
    <meta content='organic_mcmONR2002.pdf' name='reference'/>
    <meta content='AriesSchematic.png' name='reference'/>
    <meta content='AriesSchematic.ppt' name='reference'/>
    <meta content='https://savage.nps.edu/Savage/Robots/UnmannedUnderwaterVehicles/AriesPrototype.x3d' name='identifier'/>
    <meta content='X3D-Edit 3.2, https://savage.nps.edu/X3D-Edit' name='generator'/>
    <meta content='../../license.html' name='license'/>
  </head>
  <Scene>
    <!-- Produce wireframe or transparent beam cones. -->
    <WorldInfo title='AriesPrototype.x3d'/>
    <ExternProtoDeclare appinfo='Produce wireframe or transparent beam cones. Typical uses include propeller/thruster water flow or line-of-sight sonar/radar/light beams. Negative range values invert base and apex at same relative location. Default: beam with apex at (0 0 0) and base of radius 1 in x-z plane at (1 0 0).' name='BeamCone' url='"../../CommunicationsAndSensors/Beam/BeamConePrototype.x3d#BeamCone" "https://savage.nps.edu/Savage/CommunicationsAndSensors/Beam/BeamConePrototype.x3d#BeamCone" "../../CommunicationsAndSensors/Beam/BeamConePrototype.wrl#BeamCone" "https://savage.nps.edu/Savage/CommunicationsAndSensors/Beam/BeamConePrototype.wrl#BeamCone"'>
      <field accessType='initializeOnly' appinfo='BeamCone name aids tracing' name='name' type='SFString'/>
      <field accessType='inputOnly' appinfo='(communications) is transmitted signal in contact with receiver or (sensor) is a target return detected?' name='contact' type='SFBool'/>
      <field accessType='inputOnly' appinfo='distance in meters along x axis' name='range' type='SFFloat'/>
      <field accessType='initializeOnly' appinfo='distance in meters used until eventIn range sent' name='defaultRange' type='SFFloat'/>
      <field accessType='initializeOnly' appinfo='whether wireframe beam is drawn' name='wireframe' type='SFBool'/>
      <field accessType='initializeOnly' appinfo='whether solid beam is drawn' name='solid' type='SFBool'/>
      <field accessType='initializeOnly' appinfo='degrees across vertical y axis' name='beamHeightDegrees' type='SFFloat'/>
      <field accessType='initializeOnly' appinfo='degrees across horizontal z axis' name='beamWidthDegrees' type='SFFloat'/>
      <field accessType='initializeOnly' appinfo='rendering color when contact=true' name='contactColor' type='SFColor'/>
      <field accessType='initializeOnly' appinfo='rendering color when contact=false' name='noContactColor' type='SFColor'/>
      <field accessType='inputOutput' appinfo='1 = fully transparent wireframe only' name='transparency' type='SFFloat'/>
      <field accessType='initializeOnly' appinfo='flag to turn on Script tracing' name='traceEnabled' type='SFBool'/>
    </ExternProtoDeclare>
    <ProtoDeclare appinfo='Acoustic Radio Interactive Exploratory Server (ARIES) is an operational NPS-designed Unmanned Underwater Vehicle (AUV)' name='Aries'>
      <ProtoInterface>
        <field accessType='inputOutput' appinfo='can be overridden at instantiation time only' name='hullName' type='SFString' value='Aries'/>
        <field accessType='inputOutput' appinfo='hull color for this UUV instance' name='hullColor' type='SFColor' value='.9 .9 .9'/>
        <field accessType='inputOutput' appinfo='plane color for this UUV instance' name='planeColor' type='SFColor' value='.1 .1 .8'/>
        <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='inputOnly' name='set_portRpm' type='SFFloat'/>
        <field accessType='inputOnly' name='set_stbdRpm' type='SFFloat'/>
        <field accessType='inputOnly' name='set_forwardRudders' type='SFFloat'/>
        <field accessType='inputOnly' name='set_afterRudders' type='SFFloat'/>
        <field accessType='inputOnly' name='set_forwardPlanes' type='SFFloat'/>
        <field accessType='inputOnly' name='set_afterPlanes' type='SFFloat'/>
        <field accessType='inputOnly' name='set_forwardVerticalThruster' type='SFFloat'/>
        <field accessType='inputOnly' name='set_afterVerticalThruster' type='SFFloat'/>
        <field accessType='inputOnly' name='set_forwardLateralThruster' type='SFFloat'/>
        <field accessType='inputOnly' name='set_afterLateralThruster' type='SFFloat'/>
        <field accessType='inputOnly' appinfo='meters along sonar axis' name='set_ST725Range' type='SFFloat'/>
        <field accessType='inputOnly' appinfo='degrees about vertical axis' name='set_ST725Bearing' type='SFFloat'/>
        <field accessType='inputOnly' appinfo='signal-to-noise ratio decibels' name='set_ST725Intensity' type='SFFloat'/>
        <field accessType='inputOnly' appinfo='meters along sonar axis' name='set_ST1000Range' type='SFFloat'/>
        <field accessType='inputOnly' appinfo='degrees about vertical axis' name='set_ST1000Bearing' type='SFFloat'/>
        <field accessType='inputOnly' appinfo='signal-to-noise ratio decibels' name='set_ST1000Intensity' type='SFFloat'/>
      </ProtoInterface>
      <ProtoBody>
        <Transform DEF='AriesTransform'>
          <IS>
            <connect nodeField='translation' protoField='translation'/>
            <connect nodeField='rotation' protoField='rotation'/>
          </IS>
          <Transform DEF='ST725' translation='.9 -0.12 -0.03'>
            <ProtoInstance DEF='ST725BeamCone' name='BeamCone'>
              <fieldValue name='name' value='ST725BeamCone'/>
              <fieldValue name='defaultRange' value='1'/>
              <fieldValue name='beamHeightDegrees' value='24'/>
              <fieldValue name='beamWidthDegrees' value='1'/>
              <fieldValue name='solid' value='true'/>
              <fieldValue name='wireframe' value='false'/>
              <fieldValue name='contactColor' value='1 0 0'/>
              <fieldValue name='noContactColor' value='.3 .05 .05'/>
              <fieldValue name='transparency' value='.2'/>
              <fieldValue name='traceEnabled' value='false'/>
            </ProtoInstance>
          </Transform>
          <Transform DEF='ST1000' translation='.7 .12 .05'>
            <ProtoInstance DEF='ST1000BeamCone' name='BeamCone'>
              <fieldValue name='name' value='ST1000BeamCone'/>
              <fieldValue name='defaultRange' value='1'/>
              <fieldValue name='beamHeightDegrees' value='1'/>
              <fieldValue name='beamWidthDegrees' value='1'/>
              <fieldValue name='solid' value='true'/>
              <fieldValue name='wireframe' value='false'/>
              <fieldValue name='contactColor' value='1 .8 0'/>
              <fieldValue name='noContactColor' value='.4 .3 .05'/>
              <fieldValue name='transparency' value='.2'/>
              <fieldValue name='traceEnabled' value='false'/>
            </ProtoInstance>
          </Transform>
          <Script DEF='SONAR_STEERING_AND_DETECTS'>
            <field accessType='inputOnly' name='set_ST725Range' type='SFFloat'/>
            <field accessType='inputOnly' name='set_ST725Bearing' type='SFFloat'/>
            <field accessType='inputOnly' name='set_ST725Intensity' type='SFFloat'/>
            <field accessType='inputOnly' name='set_ST1000Range' type='SFFloat'/>
            <field accessType='inputOnly' name='set_ST1000Bearing' type='SFFloat'/>
            <field accessType='inputOnly' name='set_ST1000Intensity' type='SFFloat'/>
            <field accessType='outputOnly' name='ST725Rotation' type='SFRotation'/>
            <field accessType='outputOnly' name='ST1000Rotation' type='SFRotation'/>
            <field accessType='outputOnly' name='ST725Contact' type='SFBool'/>
            <field accessType='outputOnly' name='ST1000Contact' type='SFBool'/>
            <field accessType='outputOnly' name='ST725Range_changed' type='SFFloat'/>
            <field accessType='outputOnly' name='ST1000Range_changed' type='SFFloat'/>
            <field accessType='outputOnly' name='ST725Intensity' type='SFFloat'/>
            <field accessType='outputOnly' name='ST1000Intensity' type='SFFloat'/>
            <IS>
              <connect nodeField='set_ST725Range' protoField='set_ST725Range'/>
              <connect nodeField='set_ST725Bearing' protoField='set_ST725Bearing'/>
              <connect nodeField='set_ST725Intensity' protoField='set_ST725Intensity'/>
              <connect nodeField='set_ST1000Range' protoField='set_ST1000Range'/>
              <connect nodeField='set_ST1000Bearing' protoField='set_ST1000Bearing'/>
              <connect nodeField='set_ST1000Intensity' protoField='set_ST1000Intensity'/>
            </IS>
            <![CDATA[
ecmascript:

function degreeToRadian( value )
{
   return value * Math.PI / 180;
}

function set_ST725Range (value, timeStamp)
{
   if ((value > 0) && (value < 30.0))
   {
      ST725Contact = true;
      ST725Range_changed = value;
   }
   else
   {
      ST725Contact = false;
      if ( value < 0 )
         ST725Range_changed = 0.0;
      else
         ST725Range_changed = 30.0;
   }
}
function set_ST725Bearing (value, timeStamp)
{
   ST725Rotation = new SFRotation(0, 1, 0, degreeToRadian(value));
}
function set_ST725Intensity (value, timeStamp)
{
   ST725Intensity = new SFFloat(value);
}

function set_ST1000Range (value, timeStamp)
{
   if ((value > 0) && (value < 30.0))
   {
      ST1000Contact = true;
      ST1000Range_changed = value;
   }
   else
   {
      ST1000Contact = false;
      if ( value < 0 )
         ST1000Range_changed = 0.0;
      else
         ST1000Range_changed = 30.0;
   }
}
function set_ST1000Bearing (value, timeStamp)
{
   ST1000Rotation = new SFRotation(0, 1, 0, degreeToRadian(value));
}
function set_ST1000Intensity (value, timeStamp)
{
   ST1000Intensity = new SFFloat(value);
}
]]>
          </Script>
          <Group>
            <ROUTE fromField='ST725Rotation' fromNode='SONAR_STEERING_AND_DETECTS' toField='rotation' toNode='ST725'/>
            <ROUTE fromField='ST1000Rotation' fromNode='SONAR_STEERING_AND_DETECTS' toField='rotation' toNode='ST1000'/>
            <ROUTE fromField='ST725Contact' fromNode='SONAR_STEERING_AND_DETECTS' toField='contact' toNode='ST725BeamCone'/>
            <ROUTE fromField='ST1000Contact' fromNode='SONAR_STEERING_AND_DETECTS' toField='contact' toNode='ST1000BeamCone'/>
            <ROUTE fromField='ST725Range_changed' fromNode='SONAR_STEERING_AND_DETECTS' toField='range' toNode='ST725BeamCone'/>
            <ROUTE fromField='ST1000Range_changed' fromNode='SONAR_STEERING_AND_DETECTS' toField='range' toNode='ST1000BeamCone'/>
            <ROUTE fromField='ST725Intensity' fromNode='SONAR_STEERING_AND_DETECTS' toField='transparency' toNode='ST725BeamCone'/>
            <ROUTE fromField='ST1000Intensity' fromNode='SONAR_STEERING_AND_DETECTS' toField='transparency' toNode='ST1000BeamCone'/>
          </Group>
          <LOD range='400'>
            <!-- ### hack job! need to update actual numbers instead of scaling -->
            <Transform DEF='PRIMARY_AUV_GEOMETRY' scale='1 1.3 1'>
              <!-- positive rotation about y-axis rotates rudders to port -->
              <Transform DEF='FORWARD_RUDDERS' translation='.6223 0 0'>
                <Transform translation='0 .13335 0'>
                  <Shape DEF='PLANE_SHAPE'>
                    <Appearance>
                      <Material DEF='PlaneMaterial'>
                        <IS>
                          <connect nodeField='diffuseColor' protoField='planeColor'/>
                        </IS>
                      </Material>
                    </Appearance>
                    <!-- creaseAngle for sharp edges -->
                    <IndexedFaceSet coordIndex='0 3 2 1 -1 4 5 6 7 -1 0 1 5 4 -1 1 2 6 5 -1 2 3 7 6 -1 0 3 7 4 -1' creaseAngle='3.14159'>
                      <!-- indices for point values range [0..7] -->
                      <Coordinate point='.0635 0 -0.0127 .0381 .1778 -0.0127 -0.0381 .1778 -0.0127 -0.0889 0 -0.0127 .0635 0 .0127 .0381 .1778 .0127 -0.0381 .1778 .0127 -0.0889 0 .0127'/>
                    </IndexedFaceSet>
                  </Shape>
                </Transform>
                <Transform rotation='1 0 0 3.14159267' translation='0 -0.13335 0'>
                  <Shape USE='PLANE_SHAPE'/>
                </Transform>
              </Transform>
              <!-- positive rotation about y-axis rotates rudder to port -->
              <Transform DEF='AFTER_RUDDERS' translation='-0.7747 0 0'>
                <Transform translation='0 .13335 0'>
                  <Shape USE='PLANE_SHAPE'/>
                </Transform>
                <Transform rotation='1 0 0 3.14159267' translation='0 -0.13335 0'>
                  <Shape USE='PLANE_SHAPE'/>
                </Transform>
              </Transform>
              <Transform DEF='FORWARD_PLANES' translation='.6223 0 0'>
                <Transform rotation='1 0 0 1.57079' translation='0 0 .20955'>
                  <Shape USE='PLANE_SHAPE'/>
                </Transform>
                <Transform rotation='1 0 0 -1.57079' translation='0 0 -0.20955'>
                  <Shape USE='PLANE_SHAPE'/>
                </Transform>
              </Transform>
              <Transform DEF='AFTER_PLANES' translation='-0.7747 0 0'>
                <Transform rotation='1 0 0 1.57079' translation='0 0 .20955'>
                  <Shape USE='PLANE_SHAPE'/>
                </Transform>
                <Transform rotation='1 0 0 -1.57079' translation='0 0 -0.20955'>
                  <Shape USE='PLANE_SHAPE'/>
                </Transform>
              </Transform>
              <Script DEF='PLANE_SURFACES'>
                <field accessType='inputOnly' name='set_forwardRudders' type='SFFloat'/>
                <field accessType='inputOnly' name='set_afterRudders' type='SFFloat'/>
                <field accessType='inputOnly' name='set_forwardPlanes' type='SFFloat'/>
                <field accessType='inputOnly' name='set_afterPlanes' type='SFFloat'/>
                <field accessType='outputOnly' name='forwardRuddersRotation' type='SFRotation'/>
                <field accessType='outputOnly' name='afterRuddersRotation' type='SFRotation'/>
                <field accessType='outputOnly' name='forwardPlanesRotation' type='SFRotation'/>
                <field accessType='outputOnly' name='afterPlanesRotation' type='SFRotation'/>
                <IS>
                  <connect nodeField='set_forwardRudders' protoField='set_forwardRudders'/>
                  <connect nodeField='set_afterRudders' protoField='set_afterRudders'/>
                  <connect nodeField='set_forwardPlanes' protoField='set_forwardPlanes'/>
                  <connect nodeField='set_afterPlanes' protoField='set_afterPlanes'/>
                </IS>
                <![CDATA[
ecmascript:

function set_forwardRudders (value, timeStamp) {
   forwardRuddersRotation = new SFRotation(0, 1, 0, value);
}

function set_afterRudders (value, timeStamp) {
   afterRuddersRotation = new SFRotation(0, 1, 0, value);
}

function set_forwardPlanes (value, timeStamp) {
   forwardPlanesRotation = new SFRotation(0, 0, 1, value);
}

function set_afterPlanes (value, timeStamp) {
   afterPlanesRotation = new SFRotation(0, 0, 1, value);
}
]]>
              </Script>
              <Group>
                <ROUTE fromField='forwardRuddersRotation' fromNode='PLANE_SURFACES' toField='rotation' toNode='FORWARD_RUDDERS'/>
                <ROUTE fromField='afterRuddersRotation' fromNode='PLANE_SURFACES' toField='rotation' toNode='AFTER_RUDDERS'/>
                <ROUTE fromField='forwardPlanesRotation' fromNode='PLANE_SURFACES' toField='rotation' toNode='FORWARD_PLANES'/>
                <ROUTE fromField='afterPlanesRotation' fromNode='PLANE_SURFACES' toField='rotation' toNode='AFTER_PLANES'/>
              </Group>
              <Transform DEF='FORWARD_VERTICAL_THRUSTER' translation='.3302 0 0'>
                <Shape DEF='VERTICAL_THRUSTER_SHAPE'>
                  <Appearance DEF='THRUSTER_APPEARANCE'>
                    <Material diffuseColor='.2 .2 .2'/>
                  </Appearance>
                  <Cylinder height='.29' radius='.0635' side='false'/>
                </Shape>
                <Transform DEF='FORWARD_VERTICAL_BEAMCONE' rotation='0 0 1 1.57079' translation='0 .145 0'>
                  <ProtoInstance DEF='ForwardVerticalBeamCone' name='BeamCone'>
                    <fieldValue name='name' value='ForwardVerticalBeamCone'/>
                    <!-- range -1.0..0..1.0m <==> -24V..0..24V -->
                    <fieldValue name='defaultRange' value='1'/>
                    <fieldValue name='beamHeightDegrees' value='8'/>
                    <fieldValue name='beamWidthDegrees' value='8'/>
                    <fieldValue name='solid' value='false'/>
                    <fieldValue name='wireframe' value='true'/>
                    <fieldValue name='noContactColor' value='0 .8 .4'/>
                    <fieldValue name='transparency' value='0'/>
                    <fieldValue name='traceEnabled' value='false'/>
                  </ProtoInstance>
                </Transform>
              </Transform>
              <Transform DEF='AFTER_VERTICAL_THRUSTER' translation='-0.4953 0 0'>
                <Shape USE='VERTICAL_THRUSTER_SHAPE'/>
                <Transform DEF='AFTER_VERTICAL_BEAMCONE' rotation='0 0 1 1.57079' translation='0 .145 0'>
                  <ProtoInstance DEF='AfterVerticalBeamCone' name='BeamCone'>
                    <fieldValue name='name' value='AfterVerticalBeamCone'/>
                    <!-- range -1.0..0..1.0m <==> -24V..0..24V -->
                    <fieldValue name='defaultRange' value='1'/>
                    <fieldValue name='beamHeightDegrees' value='8'/>
                    <fieldValue name='beamWidthDegrees' value='8'/>
                    <fieldValue name='solid' value='false'/>
                    <fieldValue name='wireframe' value='true'/>
                    <fieldValue name='noContactColor' value='0 .8 .4'/>
                    <fieldValue name='transparency' value='0'/>
                    <fieldValue name='traceEnabled' value='false'/>
                  </ProtoInstance>
                </Transform>
              </Transform>
              <Transform DEF='FORWARD_LATERAL_THRUSTER' rotation='1 0 0 1.57079' translation='.4699 0 0'>
                <Shape DEF='LATERAL_THRUSTER_SHAPE'>
                  <Appearance USE='THRUSTER_APPEARANCE'/>
                  <Cylinder height='.44' radius='.0635' side='false'/>
                </Shape>
                <Transform DEF='FORWARD_LATERAL_BEAMCONE' rotation='0 0 1 1.57079' translation='0 .145 0'>
                  <ProtoInstance DEF='ForwardLateralBeamCone' name='BeamCone'>
                    <fieldValue name='name' value='ForwardLateralBeamCone'/>
                    <!-- range -1.0..0..1.0m <==> -24V..0..24V -->
                    <fieldValue name='defaultRange' value='1'/>
                    <fieldValue name='beamHeightDegrees' value='8'/>
                    <fieldValue name='beamWidthDegrees' value='8'/>
                    <fieldValue name='solid' value='false'/>
                    <fieldValue name='wireframe' value='true'/>
                    <fieldValue name='noContactColor' value='0 .8 .4'/>
                    <fieldValue name='transparency' value='0'/>
                    <fieldValue name='traceEnabled' value='false'/>
                  </ProtoInstance>
                </Transform>
              </Transform>
              <Transform DEF='AFTER_LATERAL_THRUSTER' rotation='1 0 0 1.57079' translation='-0.6223 0 0'>
                <Shape USE='LATERAL_THRUSTER_SHAPE'/>
                <Transform DEF='AFTER_LATERAL_BEAMCONE' rotation='0 0 1 1.57079' translation='0 .145 0'>
                  <ProtoInstance DEF='AfterLateralBeamCone' name='BeamCone'>
                    <fieldValue name='name' value='AfterLateralBeamCone'/>
                    <!-- range -1.0..0..1.0m <==> -24V..0..24V -->
                    <fieldValue name='defaultRange' value='1'/>
                    <fieldValue name='beamHeightDegrees' value='8'/>
                    <fieldValue name='beamWidthDegrees' value='8'/>
                    <fieldValue name='solid' value='false'/>
                    <fieldValue name='wireframe' value='true'/>
                    <fieldValue name='noContactColor' value='0 .8 .4'/>
                    <fieldValue name='transparency' value='0'/>
                    <fieldValue name='traceEnabled' value='false'/>
                  </ProtoInstance>
                </Transform>
              </Transform>
              <Script DEF='THRUSTER_CONES'>
                <field accessType='inputOnly' name='set_forwardVerticalThruster' type='SFFloat'/>
                <field accessType='inputOnly' name='set_afterVerticalThruster' type='SFFloat'/>
                <field accessType='inputOnly' name='set_forwardLateralThruster' type='SFFloat'/>
                <field accessType='inputOnly' name='set_afterLateralThruster' type='SFFloat'/>
                <field accessType='outputOnly' name='forwardVerticalThrusterBeamTranslation' type='SFVec3f'/>
                <field accessType='outputOnly' name='forwardVerticalThrusterBeamRange' type='SFFloat'/>
                <field accessType='outputOnly' name='afterVerticalThrusterBeamTranslation' type='SFVec3f'/>
                <field accessType='outputOnly' name='afterVerticalThrusterBeamRange' type='SFFloat'/>
                <field accessType='outputOnly' name='forwardLateralThrusterBeamTranslation' type='SFVec3f'/>
                <field accessType='outputOnly' name='forwardLateralThrusterBeamRange' type='SFFloat'/>
                <field accessType='outputOnly' name='afterLateralThrusterBeamTranslation' type='SFVec3f'/>
                <field accessType='outputOnly' name='afterLateralThrusterBeamRange' type='SFFloat'/>
                <IS>
                  <connect nodeField='set_forwardVerticalThruster' protoField='set_forwardVerticalThruster'/>
                  <connect nodeField='set_afterVerticalThruster' protoField='set_afterVerticalThruster'/>
                  <connect nodeField='set_forwardLateralThruster' protoField='set_forwardLateralThruster'/>
                  <connect nodeField='set_afterLateralThruster' protoField='set_afterLateralThruster'/>
                </IS>
                <![CDATA[
ecmascript:

function set_forwardVerticalThruster (value, timeStamp) {
   if (value >= 0)
      forwardVerticalThrusterBeamTranslation = new SFVec3f(0, .145, 0);
   else
      forwardVerticalThrusterBeamTranslation = new SFVec3f(0, -0.145 + value, 0);

   forwardVerticalThrusterBeamRange = value;
}

function set_afterVerticalThruster (value, timeStamp) {
   if (value >= 0)
      afterVerticalThrusterBeamTranslation = new SFVec3f(0, .145, 0);
   else
      afterVerticalThrusterBeamTranslation = new SFVec3f(0, -0.145 + value, 0);

   afterVerticalThrusterBeamRange = value;
}

function set_forwardLateralThruster (value, timeStamp) {
   if (value >= 0)
      forwardLateralThrusterBeamTranslation = new SFVec3f(0, .21, 0);
   else
      forwardLateralThrusterBeamTranslation = new SFVec3f(0, -0.21 + value, 0);

   forwardLateralThrusterBeamRange = value;
}

function set_afterLateralThruster (value, timeStamp) {
   if (value >= 0)
      afterLateralThrusterBeamTranslation = new SFVec3f(0, .21, 0);
   else
      afterLateralThrusterBeamTranslation = new SFVec3f(0, -0.21 + value, 0);

   afterLateralThrusterBeamRange = value;
}
]]>
              </Script>
              <Group>
                <ROUTE fromField='forwardVerticalThrusterBeamTranslation' fromNode='THRUSTER_CONES' toField='translation' toNode='FORWARD_VERTICAL_BEAMCONE'/>
                <ROUTE fromField='forwardVerticalThrusterBeamRange' fromNode='THRUSTER_CONES' toField='range' toNode='ForwardVerticalBeamCone'/>
                <ROUTE fromField='afterVerticalThrusterBeamTranslation' fromNode='THRUSTER_CONES' toField='translation' toNode='AFTER_VERTICAL_BEAMCONE'/>
                <ROUTE fromField='afterVerticalThrusterBeamRange' fromNode='THRUSTER_CONES' toField='range' toNode='AfterVerticalBeamCone'/>
                <ROUTE fromField='forwardLateralThrusterBeamTranslation' fromNode='THRUSTER_CONES' toField='translation' toNode='FORWARD_LATERAL_BEAMCONE'/>
                <ROUTE fromField='forwardLateralThrusterBeamRange' fromNode='THRUSTER_CONES' toField='range' toNode='ForwardLateralBeamCone'/>
                <ROUTE fromField='afterLateralThrusterBeamTranslation' fromNode='THRUSTER_CONES' toField='translation' toNode='AFTER_LATERAL_BEAMCONE'/>
                <ROUTE fromField='afterLateralThrusterBeamRange' fromNode='THRUSTER_CONES' toField='range' toNode='AfterLateralBeamCone'/>
              </Group>
              <Shape DEF='HULL'>
                <Appearance DEF='HULL_APPEARANCE'>
                  <Material DEF='HullMaterial'>
                    <IS>
                      <connect nodeField='diffuseColor' protoField='hullColor'/>
                    </IS>
                  </Material>
                </Appearance>
                <IndexedFaceSet coordIndex='0 26 34 33 32 31 25 1 -1 1 25 31 32 33 34 26 0 -1 1 25 29 28 2 -1 2 28 29 25 1 -1 2 28 35 36 37 38 27 3 -1 3 27 38 37 36 35 28 2 -1 3 27 30 26 0 -1 0 26 30 27 3 -1 0 4 1 -1 0 1 4 -1 1 5 2 -1 1 2 5 -1 2 6 3 -1 2 3 6 -1 3 7 0 -1 3 0 7 -1 7 0 8 -1 7 8 0 -1 8 0 9 -1 8 9 0 -1 9 0 4 -1 9 4 0 -1 4 1 10 -1 4 10 1 -1 10 1 11 -1 10 11 1 -1 11 1 5 -1 11 5 1 -1 5 2 12 -1 5 12 2 -1 12 2 13 -1 12 13 2 -1 13 2 6 -1 13 6 2 -1 6 3 14 -1 6 14 3 -1 14 3 15 -1 14 15 3 -1 15 3 7 -1 15 7 3 -1 4 10 16 -1 10 4 16 -1 10 11 16 -1 11 10 16 -1 11 5 17 -1 5 11 17 -1 5 12 18 -1 12 5 18 -1 12 13 19 -1 13 12 19 -1 13 6 19 -1 6 13 19 -1 6 14 20 -1 14 6 20 -1 14 15 20 -1 15 14 20 -1 15 7 21 -1 7 15 21 -1 7 8 22 -1 8 7 22 -1 8 9 23 -1 9 8 23 -1 9 4 23 -1 4 9 23 -1 4 16 23 -1 16 4 23 -1 11 17 16 -1 17 11 16 -1 5 18 17 -1 18 5 17 -1 12 19 18 -1 19 12 18 -1 6 20 19 -1 20 6 19 -1 20 15 21 -1 15 20 21 -1 21 7 22 -1 7 21 22 -1 22 8 23 -1 8 22 23 -1 23 16 24 -1 16 23 24 -1 16 17 24 -1 17 16 24 -1 17 18 24 -1 18 17 24 -1 18 19 24 -1 19 18 24 -1 19 20 24 -1 20 19 24 -1 20 21 24 -1 21 20 24 -1 21 22 24 -1 22 21 24 -1 22 23 24 -1 23 22 24 -1 25 26 30 29 -1 29 30 26 25 -1 27 28 29 30 -1 30 29 28 27 -1 31 32 36 35 -1 35 36 32 31 -1 32 33 37 36 -1 36 37 33 32 -1 34 38 37 33 -1 33 37 38 34 -1' creaseAngle='2.2'>
                  <!-- Bow Cowling [0..24], Stern Cowling [25..30], Rudder Post [31..38] -->
                  <Coordinate point='.6985 .13335 -0.20955 .6985 .13335 .20955 .6985 -0.13335 .20955 .6985 -0.13335 -0.20955 1.05 .085 0 1.05 0 .1143 1.05 -0.085 0 1.05 0 -0.1143 1.05 .04572 -0.098985 1.05 .079188 -0.05715 1.05 .079188 .05715 1.05 .04572 .098985 1.05 -0.04572 .098985 1.05 -0.079188 .05715 1.05 -0.079188 -0.05715 1.05 -0.04572 -0.098985 1.1 .04064 .02032 1.1 .02032 .06096 1.1 -0.02032 .06096 1.1 -0.04064 .02032 1.1 -0.04064 -0.02032 1.1 -0.02032 -0.06096 1.1 .02032 -0.06096 1.1 .04064 -0.02032 1.11 0 0 -0.6985 .13335 .20955 -0.6985 .13335 -0.20955 -0.6985 -0.13335 -0.20955 -0.6985 -0.13335 .20955 -1.1303 0 .20955 -1.1303 0 -0.20955 -0.6985 .13335 .0635 -0.8509 .13335 .0635 -0.8509 .13335 -0.0635 -0.6985 .13335 -0.0635 -0.6985 -0.13335 .0635 -0.8509 -0.13335 .0635 -0.8509 -0.13335 -0.0635 -0.6985 -0.13335 -0.0635'/>
                </IndexedFaceSet>
              </Shape>
              <!-- original translation -1.1557 0 .09525 -->
              <Transform DEF='STARTBOARD_SCREW_BEAMCONE_AND_SHAFT' translation='-1.3 0 .3'>
                <Transform DEF='STARTBOARD_THRUSTER_BODY' rotation='0 0 1 1.57' translation='.15 0 0'>
                  <Shape>
                    <Appearance DEF='THRUSTER_BODY_APPEARANCE'>
                      <Material diffuseColor='.9 .9 .9'/>
                    </Appearance>
                    <Cylinder height='.16' radius='.08'/>
                  </Shape>
                  <Shape>
                    <Appearance DEF='THRUSTER_INNERBODY_APPEARANCE'>
                      <Material diffuseColor='.2 .2 .2'/>
                    </Appearance>
                    <Cylinder height='.22' radius='.06'/>
                  </Shape>
                </Transform>
                <Transform DEF='STARBOARD_THRUSTER_BRACKET' rotation='0 0 1 1.57' translation='.2 0 -0.05'>
                  <Shape>
                    <Appearance>
                      <Material diffuseColor='.9 .9 .9'/>
                    </Appearance>
                    <Box size='.02 .05 .2'/>
                  </Shape>
                </Transform>
                <Transform DEF='STARBOARD_SCREW_BEAMCONE' rotation='0 1 0 3.14'>
                  <ProtoInstance DEF='StarboardScrewBeamCone' name='BeamCone'>
                    <fieldValue name='name' value='StarboardScrewBeamCone'/>
                    <!-- range values -1..0..1m <==> -700..0..700 RPM -->
                    <fieldValue name='defaultRange' value='1'/>
                    <fieldValue name='beamHeightDegrees' value='8'/>
                    <fieldValue name='beamWidthDegrees' value='8'/>
                    <fieldValue name='solid' value='false'/>
                    <fieldValue name='wireframe' value='true'/>
                    <fieldValue name='noContactColor' value='0 .8 .4'/>
                    <fieldValue name='transparency' value='0'/>
                    <fieldValue name='traceEnabled' value='false'/>
                    <IS>
                      <connect nodeField='range' protoField='set_stbdRpm'/>
                    </IS>
                  </ProtoInstance>
                </Transform>
                <Group DEF='SHAFT'>
                  <Transform rotation='0 0 1 1.57079' translation='.0281 0 0'>
                    <Shape DEF='SCREW_SHAFT'>
                      <Appearance DEF='SCREW_APPEARANCE'>
                        <Material diffuseColor='.226 .197 0'/>
                      </Appearance>
                      <Cylinder bottom='false' height='.0762' radius='.008' top='false'/>
                    </Shape>
                  </Transform>
                  <Transform rotation='0 0 1 1.57079' translation='-0.015 0 0'>
                    <Shape DEF='SHAFT_END_CAP'>
                      <Appearance USE='SCREW_APPEARANCE'/>
                      <Cone bottom='false' bottomRadius='.008' height='.01'/>
                    </Shape>
                  </Transform>
                </Group>
              </Transform>
              <!-- original translation -1.1557 0 .09525 -->
              <Transform DEF='STARBOARD_SCREW' translation='-1.3 0 .3'>
                <Transform DEF='STARBOARD_BLADE'>
                  <Transform rotation='0 1 0 -0.39'>
                    <Shape>
                      <Appearance USE='SCREW_APPEARANCE'/>
                      <IndexedFaceSet coordIndex='0 1 2 3 4 5 6 7 -1 0 7 6 5 4 3 2 1 -1'>
                        <Coordinate DEF='BLADE_COORDINATES' point='0 0 -0.00508 0 .02540 -0.02032 0 .04572 -0.01524 0 .05080 -0.00508 0 .05080 .00508 0 .04572 .01524 0 .02540 .02032 0 0 .00508'/>
                      </IndexedFaceSet>
                    </Shape>
                  </Transform>
                </Transform>
                <Transform rotation='1 0 0 1.57079'>
                  <Transform USE='STARBOARD_BLADE'/>
                </Transform>
                <Transform rotation='1 0 0 3.14159267'>
                  <Transform USE='STARBOARD_BLADE'/>
                </Transform>
                <Transform rotation='1 0 0 -1.57079'>
                  <Transform USE='STARBOARD_BLADE'/>
                </Transform>
              </Transform>
              <!-- original translation -1.1557 0 -0.09525 -->
              <Transform DEF='PORT_SCREW_BEAMCONE_AND_SHAFT' translation='-1.3 0 -0.3'>
                <Transform DEF='PORT_THRUSTER_BODY' rotation='0 0 1 1.57' translation='.15 0 0'>
                  <Shape>
                    <Appearance USE='THRUSTER_BODY_APPEARANCE'/>
                    <Cylinder height='.16' radius='.08'/>
                  </Shape>
                  <Shape>
                    <Appearance USE='THRUSTER_INNERBODY_APPEARANCE'/>
                    <Cylinder height='.22' radius='.05'/>
                  </Shape>
                </Transform>
                <Transform DEF='PORT_THRUSTER_BRACKET' rotation='0 0 1 1.57' translation='.2 0 .05'>
                  <Shape>
                    <Appearance>
                      <Material diffuseColor='.9 .9 .9'/>
                    </Appearance>
                    <Box size='.02 .05 .2'/>
                  </Shape>
                </Transform>
                <Transform DEF='PORT_SCREW_BEAMCONE' rotation='0 1 0 3.14'>
                  <ProtoInstance DEF='PortScrewBeamCone' name='BeamCone'>
                    <fieldValue name='name' value='PortScrewBeamCone'/>
                    <!-- range values -1..0..1 m <==> -700..0..700 RPM -->
                    <fieldValue name='defaultRange' value='1'/>
                    <fieldValue name='beamHeightDegrees' value='8'/>
                    <fieldValue name='beamWidthDegrees' value='8'/>
                    <fieldValue name='solid' value='false'/>
                    <fieldValue name='wireframe' value='true'/>
                    <!-- Greenish blue for sea water flow -->
                    <fieldValue name='noContactColor' value='0 .8 .4'/>
                    <fieldValue name='transparency' value='0'/>
                    <fieldValue name='traceEnabled' value='false'/>
                    <IS>
                      <connect nodeField='range' protoField='set_portRpm'/>
                    </IS>
                  </ProtoInstance>
                </Transform>
                <Group USE='SHAFT'/>
              </Transform>
              <!-- original translation -1.1557 0 -0.09525 -->
              <Transform DEF='PORT_SCREW' translation='-1.3 0 -0.3'>
                <Group DEF='PORT_BLADE'>
                  <Transform rotation='0 1 0 .39'>
                    <Shape>
                      <Appearance USE='SCREW_APPEARANCE'/>
                      <IndexedFaceSet coordIndex='0 1 2 3 4 5 6 7 -1 0 7 6 5 4 3 2 1 -1'>
                        <!-- This blade has reversed pitch -->
                        <Coordinate USE='BLADE_COORDINATES'/>
                      </IndexedFaceSet>
                    </Shape>
                  </Transform>
                </Group>
                <Transform rotation='1 0 0 1.57079'>
                  <Group USE='PORT_BLADE'/>
                </Transform>
                <Transform rotation='1 0 0 3.14159267'>
                  <Group USE='PORT_BLADE'/>
                </Transform>
                <Transform rotation='1 0 0 -1.57079'>
                  <Group USE='PORT_BLADE'/>
                </Transform>
              </Transform>
            </Transform>
            <Shape>
              <!-- Medium-resolution LOD level -->
              <Appearance USE='HULL_APPEARANCE'/>
              <!-- size is full length, height, width -->
              <Box size='2.2 .26 .42'/>
            </Shape>
          </LOD>
          <Group>
            <Viewpoint DEF='HULLNAME_VIEWPOINT' description='Aries Prototype' position='0 0 4'>
              <IS>
                <connect nodeField='description' protoField='hullName'/>
              </IS>
            </Viewpoint>
            <Viewpoint description='Port Bow' orientation='0 1 0 2.356' position='8 0 -8'/>
            <Viewpoint description='Bow' orientation='0 1 0 1.572' position='10 0 0'/>
            <Viewpoint description='Starboard Bow' orientation='0 1 0 0.785' position='8 0 8'/>
            <Viewpoint description='Port Beam' orientation='0 1 0 3.14159267' position='0 0 -10'/>
            <Viewpoint description='Port Astern' orientation='0 1 0 3.926' position='-8 0 -8'/>
            <Viewpoint description='Astern' orientation='0 1 0 -1.4' position='-10 0 0'/>
            <Viewpoint description='Starboard Astern' orientation='0 1 0 -0.783' position='-10 0 10'/>
            <Viewpoint description='Looking down from 25m above Aries' orientation='1 0 0 -1.57' position='0 25 0'/>
          </Group>
        </Transform>
      </ProtoBody>
    </ProtoDeclare>
    <Viewpoint description='Aries AUV'/>
    <Group>
      <ProtoInstance name='Aries'>
        <fieldValue name='translation' value='0 0.4 0'/>
      </ProtoInstance>
    </Group>
    <!-- Viewable geometry is anchored text that links to an example that showing the usage of AriesPrototype -->
    <Anchor description='AriesExample' parameter='"target=_blank"' url='"AriesExample.x3d" "https://savage.nps.edu/Savage/Robots/UnmannedUnderwaterVehicles/AriesExample.x3d" "AriesExample.wrl" "https://savage.nps.edu/Savage/Robots/UnmannedUnderwaterVehicles/AriesExample.wrl"'>
      <Shape>
        <Appearance>
          <Material diffuseColor='0 1 1' emissiveColor='0 1 1'/>
        </Appearance>
        <Text string='"AriesPrototype" "is a prototype definition file" "" "click on text to view" "AriesExample"'>
          <FontStyle justify='"MIDDLE" "MIDDLE"'/>
        </Text>
      </Shape>
    </Anchor>
  </Scene>
</X3D>