<?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='MultipleExplosionPrototype.x3d' name='title'/>
    <meta content='Simple prototype for a multiple explosion resulting from a tomahawk strike.' name='description'/>
    <meta content='James Harney' name='creator'/>
    <meta content='14 September 2001' name='created'/>
    <meta content='28 November 2019' name='modified'/>
    <meta content='http://www.planetnine.com' name='reference'/>
    <meta content='http://www.specialoperations.com/multimedia/sounds.html' name='reference'/>
    <meta content='See url "soundpermissions.html" for copyright info and use on missile1.au and exp03.au that are converted to missile1.wav and exp03.wav for use in this file/model' name='reference'/>
    <meta content='soundpermissions.html' name='accessRights'/>
    <meta content='explosion.png' name='reference'/>
    <meta content='https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/MultipleExplosionPrototype.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='MultipleExplosionPrototype.x3d'/>
    <ProtoDeclare name='TLAMEXPLOSION'>
      <ProtoInterface>
        <field accessType='inputOnly' name='STARTEXPLOSION' type='SFBool'/>
        <field accessType='inputOnly' name='THETIME' type='SFTime'/>
      </ProtoInterface>
      <ProtoBody>
        <Transform DEF='EXPLOSION' scale='.001 .001 .001'>
          <Shape>
            <Sphere DEF='EXPSHAPE' radius='25'/>
            <Appearance>
              <!-- explosion.png is from the Pearl Harbor scene from www.planetnine.com. -->
              <ImageTexture DEF='explosion' url='"explosion.png" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/explosion.png"'/>
            </Appearance>
          </Shape>
          <!-- Script based on example 30.3 from VRML source book. Modified to create animations that have delayed start times from the same touch sensor. -->
          <Script DEF='TimeFilter'>
            <field accessType='inputOnly' name='setStart' type='SFBool'/>
            <field accessType='outputOnly' name='startEventTime' type='SFTime'/>
            <field accessType='inputOnly' name='InputTime' type='SFTime'/>
            <IS>
              <connect nodeField='setStart' protoField='STARTEXPLOSION'/>
              <connect nodeField='InputTime' protoField='THETIME'/>
            </IS>
            <![CDATA[
ecmascript:


function setStart ( value, InputTime ) {
                         
	startEventTime = InputTime + 28 ;
	
}
]]>
          </Script>
          <!-- Used with permission. See soundpermissions.html for details. -->
          <Sound maxBack='50000' maxFront='50000'>
            <AudioClip DEF='IMPACT' description='Explosion' url='"EXP03.wav" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/EXP03.wav"'/>
          </Sound>
          <Transform DEF='EXPLOSION1' scale='.001 .001 .001' translation='1 3 -10'>
            <Shape>
              <Sphere DEF='EXPSHAPE1' radius='15'/>
              <Appearance>
                <ImageTexture USE='explosion'/>
              </Appearance>
            </Shape>
            <!-- Script based on example 30.3 from VRML source book. Modified to create animations that have delayed start times from the same touch sensor. -->
            <!-- Used with permission. See soundpermissions.html for details. -->
            <Sound maxBack='50000' maxFront='50000'>
              <AudioClip USE='IMPACT'/>
            </Sound>
          </Transform>
          <Transform DEF='EXPLOSION2' scale='.001 .001 .001' translation='-5 12 7'>
            <Shape>
              <Sphere DEF='EXPSHAPE2' radius='10'/>
              <Appearance>
                <!-- explosion.png is from the Pearl Harbor scene from www.planetnine.com. -->
                <ImageTexture USE='explosion'/>
              </Appearance>
            </Shape>
            <!-- Script based on example 30.3 from VRML source book. Modified to create animations that have delayed start times from the same touch sensor. -->
            <!-- Used with permission. See soundpermissions.html for details. -->
            <Sound maxBack='50000' maxFront='50000'>
              <AudioClip USE='IMPACT'/>
            </Sound>
          </Transform>
        </Transform>
        <TimeSensor DEF='EXPCLOCK' cycleInterval='16'/>
        <TimeSensor DEF='EXPCLOCK1' cycleInterval='16'/>
        <TimeSensor DEF='EXPCLOCK2' cycleInterval='16'/>
        <PositionInterpolator DEF='EXPINTERP' key='0 .25 .5 1' keyValue='1 1 1 2.5 2.5 2.5 3 3 3 .01 .01 .01'/>
        <PositionInterpolator DEF='EXPINTERP1' key='0 .2 .5 1' keyValue='.05 .05 .05 2.5 2.5 2.5 3 3 3 .01 .01 .01'/>
        <PositionInterpolator DEF='EXPINTERP2' key='0 .1 .5 1' keyValue='.4 .4 .4 2.5 2.5 2.5 3 3 3 .01 .01 .01'/>
        <ROUTE fromField='startEventTime' fromNode='TimeFilter' toField='set_startTime' toNode='EXPCLOCK'/>
        <ROUTE fromField='startEventTime' fromNode='TimeFilter' toField='set_startTime' toNode='EXPCLOCK1'/>
        <ROUTE fromField='startEventTime' fromNode='TimeFilter' toField='set_startTime' toNode='EXPCLOCK2'/>
        <ROUTE fromField='startEventTime' fromNode='TimeFilter' toField='set_startTime' toNode='IMPACT'/>
        <ROUTE fromField='fraction_changed' fromNode='EXPCLOCK' toField='set_fraction' toNode='EXPINTERP'/>
        <ROUTE fromField='fraction_changed' fromNode='EXPCLOCK' toField='set_fraction' toNode='EXPINTERP1'/>
        <ROUTE fromField='fraction_changed' fromNode='EXPCLOCK' toField='set_fraction' toNode='EXPINTERP2'/>
        <ROUTE fromField='value_changed' fromNode='EXPINTERP' toField='set_scale' toNode='EXPLOSION'/>
        <ROUTE fromField='value_changed' fromNode='EXPINTERP' toField='set_scale' toNode='EXPLOSION1'/>
        <ROUTE fromField='value_changed' fromNode='EXPINTERP' toField='set_scale' toNode='EXPLOSION2'/>
      </ProtoBody>
    </ProtoDeclare>
    <!-- ==================== -->
    <Background skyColor='0.604 0.753 0.804'/>
    <Anchor description='Missile Explosion Example' parameter='"target=_blank"' url='"MissileExplosionExample.wrl" "../../Weapons/Missiles/MissileExplosionExample.wrl" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/MissileExplosionExample.wrl" "MissileExplosionExample.x3d" "../../Weapons/Missiles/MissileExplosionExample.x3d" "https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/MissileExplosionExample.x3d"'>
      <Shape>
        <Text string='"MultipleExplosionPrototype" "is a prototype declaration file" "" "To see an example scene" "click on this text and view" "MultipleExplosionExample"'>
          <FontStyle justify='"MIDDLE" "MIDDLE"'/>
        </Text>
        <Appearance/>
      </Shape>
    </Anchor>
  </Scene>
</X3D>