<?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.1VisibilitySensorDungeonSlidingDoors.x3d' name='title'/>
    <meta content='Figure 27.1, 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/27fig01.htm' name='reference'/>
    <meta content='Don Brutzman' name='translator'/>
    <meta content='26 October 2000' name='created'/>
    <meta content='1 February 2014' name='modified'/>
    <meta content='Figure27.1VisibilitySensorDungeonSlidingDoors.png' name='Image'/>
    <meta content='A dungeon door that slides open when visible, and slides closed when not visible. When you are look away from the door it goes shut, then it reopens when you look back. Page up/down between the first two viewpoints to observe this behavior. Arrow keys also help you peek left/right. Interesting side effect: users can&apos;t back up through the closed door.' name='description'/>
    <meta content='http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27-SensingVisibilityProximityCollision/Figure27.1VisibilitySensorDungeonSlidingDoors.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 doors open, because they are visible' fieldOfView='1.05' position='0 2 10'/>
    <Viewpoint description='Now doors close, because they are not visible' fieldOfView='1.05' orientation='0 1 0 -0.85' position='0 2 5'/>
    <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>
        <VisibilitySensor DEF='DoorSense' center='0 1.75 0' size='3 2.5 1'/>
      </Transform>
      <Sound maxBack='60' maxFront='60' minBack='20' minFront='20'>
        <AudioClip DEF='OpenSound' description='door clunks open' 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='door clunks shut' url='"clunk1.wav" "../Chapter27-SensingVisibilityProximityCollision/clunk1.wav" "http://www.web3d.org/x3d/content/examples/Vrml2Sourcebook/Chapter27-SensingVisibilityProximityCollision/clunk1.wav"'/>
      </Sound>
      <TimeSensor DEF='OpenClock' cycleInterval='2'/>
      <TimeSensor DEF='CloseClock' cycleInterval='2'/>
      <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>