<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.0//EN" "http://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='http://www.web3d.org/specifications/x3d-3.0.xsd'>
  <head>
    <meta content='Figure27.2ProximitySensorDungeonSlidingDoors.x3d' name='title'/>
    <meta content='Figure 27.2, The VRML 2.0 Sourcebook, Copyright [1997] By Andrea L. Ames, David R. Nadeau, and John L. Moreland' name='creator'/>
    <meta content='http://www.wiley.com/legacy/compbooks/vrml2sbk/ch27/27fig02.htm' name='reference'/>
    <meta content='Don Brutzman' name='translator'/>
    <meta content='26 October 2000' name='created'/>
    <meta content='11 January 2014' name='modified'/>
    <meta content='A dungeon door that slides open when the ProximitySensor detects the viewer close enough. Later the doors close when the viewer moves out of range from the ProximitySensor.' name='description'/>
    <meta content='http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27-SensingVisibilityProximityCollision/Figure27.2ProximitySensorDungeonSlidingDoors.x3d' name='identifier'/>
    <meta content='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit' name='generator'/>
    <meta content='../../license.html' name='license'/>
  </head>
  <Scene>
    <Viewpoint description='Now you see doors closed, because they are far away' fieldOfView='1.05' position='0 2 10'/>
    <Viewpoint description='Now you see doors opened, because you are close' fieldOfView='1.05' position='0 2 -1'/>
    <NavigationInfo avatarSize='0.5 1.6 0.5' headlight='false' speed='2' type='"WALK" "EXAMINE" "ANY"'/>
    <Group>
      <LOD range='20'>
        <Inline DEF='DungeonRoom' url='"../Chapter25-LevelOfDetail/Figure25.08DungeonRoom.x3d" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter25-LevelOfDetail/Figure25.08DungeonRoom.x3d" "../Chapter25-LevelOfDetail/Figure25.08DungeonRoom.wrl" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter25-LevelOfDetail/Figure25.08DungeonRoom.wrl"'/>
        <WorldInfo info='"null node"'/>
      </LOD>
      <Transform translation='0 0 -10'>
        <LOD range='20'>
          <Inline USE='DungeonRoom'/>
          <WorldInfo info='"null node"'/>
        </LOD>
      </Transform>
      <Transform translation='0 0 -5'>
        <Inline url='"../Chapter25-LevelOfDetail/Figure25.10DungeonWallWithDoorway.x3d" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter25-LevelOfDetail/Figure25.10DungeonWallWithDoorway.x3d" "../Chapter25-LevelOfDetail/Figure25.10DungeonWallWithDoorway.wrl" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter25-LevelOfDetail/Figure25.10DungeonWallWithDoorway.wrl"'/>
      </Transform>
      <Transform rotation='0 1 0 1.57' scale='1 1 2' translation='0 0 -15'>
        <Inline url='"../Chapter25-LevelOfDetail/Figure25.07DungeonRoomWall.x3d" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter25-LevelOfDetail/Figure25.07DungeonRoomWall.x3d" "../Chapter25-LevelOfDetail/Figure25.07DungeonRoomWall.wrl" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter25-LevelOfDetail/Figure25.07DungeonRoomWall.wrl"'/>
      </Transform>
      <Transform translation='0 0 -4.95'>
        <Transform DEF='LeftDoor'>
          <Transform translation='-0.75 0 0'>
            <Inline DEF='Door' url='"../Chapter25-LevelOfDetail/Figure25.11DungeonDoor.x3d" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter25-LevelOfDetail/Figure25.11DungeonDoor.x3d" "../Chapter25-LevelOfDetail/Figure25.11DungeonDoor.wrl" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter25-LevelOfDetail/Figure25.11DungeonDoor.wrl"'/>
          </Transform>
        </Transform>
        <Transform DEF='RightDoor'>
          <Transform translation='0.75 0 0'>
            <Inline USE='Door'/>
          </Transform>
        </Transform>
        <ProximitySensor DEF='DoorSense' center='0 1.75 0' size='6 3.5 8'/>
      </Transform>
      <Sound maxBack='60' maxFront='60' minBack='20' minFront='20'>
        <AudioClip DEF='OpenSound' description='clunk!' url='"clunk1.wav" "../Chapter27-SensingVisibilityProximityCollision/clunk1.wav" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27-SensingVisibilityProximityCollision/clunk1.wav"'/>
      </Sound>
      <Sound maxBack='60' maxFront='60' minBack='20' minFront='20'>
        <AudioClip DEF='CloseSound' description='clunk!' url='"clunk1.wav" "../Chapter27-SensingVisibilityProximityCollision/clunk1.wav" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27-SensingVisibilityProximityCollision/clunk1.wav"'/>
      </Sound>
      <TimeSensor DEF='OpenClock' cycleInterval='0.5'/>
      <TimeSensor DEF='CloseClock'/>
      <PositionInterpolator DEF='LeftOpen' key='0 1' keyValue='0 0 0 -1.3 0 0'/>
      <PositionInterpolator DEF='LeftClose' key='0 1' keyValue='-1.3 0 0 0 0 0'/>
      <PositionInterpolator DEF='RightOpen' key='0 1' keyValue='0 0 0 1.3 0 0'/>
      <PositionInterpolator DEF='RightClose' key='0 1' keyValue='1.3 0 0 0 0 0'/>
    </Group>
    <!-- open door -->
    <ROUTE fromField='enterTime' fromNode='DoorSense' toField='set_startTime' toNode='OpenSound'/>
    <ROUTE fromField='exitTime' fromNode='DoorSense' toField='set_stopTime' toNode='OpenSound'/>
    <ROUTE fromField='enterTime' fromNode='DoorSense' toField='set_startTime' toNode='OpenClock'/>
    <ROUTE fromField='exitTime' fromNode='DoorSense' toField='set_stopTime' toNode='OpenClock'/>
    <!-- close door -->
    <ROUTE fromField='exitTime' fromNode='DoorSense' toField='set_startTime' toNode='CloseSound'/>
    <ROUTE fromField='enterTime' fromNode='DoorSense' toField='set_stopTime' toNode='CloseSound'/>
    <ROUTE fromField='exitTime' fromNode='DoorSense' toField='set_startTime' toNode='CloseClock'/>
    <ROUTE fromField='enterTime' fromNode='DoorSense' toField='set_stopTime' toNode='CloseClock'/>
    <!-- door timers -->
    <ROUTE fromField='fraction_changed' fromNode='OpenClock' toField='set_fraction' toNode='LeftOpen'/>
    <ROUTE fromField='fraction_changed' fromNode='OpenClock' toField='set_fraction' toNode='RightOpen'/>
    <ROUTE fromField='fraction_changed' fromNode='CloseClock' toField='set_fraction' toNode='LeftClose'/>
    <ROUTE fromField='fraction_changed' fromNode='CloseClock' toField='set_fraction' toNode='RightClose'/>
    <!-- door translations -->
    <ROUTE fromField='value_changed' fromNode='LeftOpen' toField='set_translation' toNode='LeftDoor'/>
    <ROUTE fromField='value_changed' fromNode='RightOpen' toField='set_translation' toNode='RightDoor'/>
    <ROUTE fromField='value_changed' fromNode='LeftClose' toField='set_translation' toNode='LeftDoor'/>
    <ROUTE fromField='value_changed' fromNode='RightClose' toField='set_translation' toNode='RightDoor'/>
  </Scene>
</X3D>