<?xml version="1.0" encoding="UTF-8"?>
<!DOCTYPE X3D PUBLIC "ISO//Web3D//DTD X3D 3.3//EN" "https://www.web3d.org/specifications/x3d-3.3.dtd">
<X3D profile='Immersive' version='3.3 xmlns:xsd='http://www.w3.org/2001/XMLSchema-instance' xsd:noNamespaceSchemaLocation =' https://www.web3d.org/specifications/x3d-3.3.xsd '>
<head>
<meta name='titlecontent='SphericalMinePrototype.x3d'/>
<meta name='creatorcontent='Don Brutzman'/>
<meta name='createdcontent='26 June 2000'/>
<meta name='modifiedcontent='28 November 2019'/>
<meta name='descriptioncontent='Underwater mine prototype SphericalMine. Note level of detail (LOD) transitions when seen at transition ranges.'/>
<meta name='identifiercontent=' https://savage.nps.edu/Savage/Weapons/UnderwaterMines/SphericalMinePrototype.x3d '/>
<meta name='generatorcontent='X3D-Edit 3.3, https://savage.nps.edu/X3D-Edit'/>
<meta name='licensecontent=' ../../license.html'/>
</head>
<!-- -->
<Scene>
<!-- SphericalMine is a simple notional mine -->
<WorldInfo title='SphericalMinePrototype.x3d'/>
<ProtoDeclare name='SphericalMineappinfo='Spherical floating mine moored to bottom'>
<ProtoInterface>
<field name='descriptiontype='SFStringvalue='10 m: Spherical MineaccessType='initializeOnly'
 appinfo='Description for each mine contact.'/>

<field name='colortype='SFColorvalue='.8 .8 .8accessType='inputOutput'
 appinfo='Mine color can be used to indicate status (found/unknown/disabled/) tactic etc.'/>

<field name='translationtype='SFVec3fvalue='0 0 0accessType='inputOutput'
 appinfo='Location of mine center in local world coordinates.'/>

<field name='scaletype='SFVec3fvalue='1 1 1accessType='inputOutput'
 appinfo='Scale factor to change spherical mine size default diameter = 1m.'/>

<field name='bboxCentertype='SFVec3fvalue='0 0 0accessType='initializeOnly'
 appinfo='Bounding box for collision detection of mine.'/>

<field name='tetherPointstype='MFVec3fvalue='0 0 0 0 -10 0accessType='inputOutput'
 appinfo='Top and bottom endpoints of line tether that anchors this mine to the bottom.'/>

<field name='proximityIsActivetype='SFBoolaccessType='outputOnly'
 appinfo='proximityIsActive can be used to activate information or interaction when the viewer nears the mine.'/>

<field name='proximitySizetype='SFVec3fvalue='10 10 10accessType='inputOutput'
 appinfo='proximitySize provides overall box dimensions for proximity; thus (10 10 10) yields approximate radius 5 to 7 meters.'/>
</ProtoInterface>
<ProtoBody>
<Transform DEF='LOCATOR'>
<IS>
<connect nodeField='translationprotoField='translation'/>
<connect nodeField='scaleprotoField='scale'/>
<connect nodeField='bboxCenterprotoField='bboxCenter'/>
</IS>
<LOD range='100 500 5000'>
<!-- High resolution -->
<Group>
<Viewpoint DEF='UW_MINE_VIEWPOINT'>
<IS>
<connect nodeField='descriptionprotoField='description'/>
</IS>
</Viewpoint>
<ProximitySensor DEF='UW_MINE_PROXIMITY'>
<IS>
<connect nodeField='isActiveprotoField='proximityIsActive'/>
<connect nodeField='sizeprotoField='proximitySize'/>
</IS>
</ProximitySensor>
<Shape DEF='UW_MINE_SPHERE'>
<Sphere radius='.5'/>
<Appearance DEF='UW_MINE_APPEARANCE'>
<Material DEF='UW_MINE_MATERIALshininess='.5'>
<IS>
<connect nodeField='diffuseColorprotoField='color'/>
</IS>
</Material>
</Appearance>
</Shape>
<Transform translation='0 .49 0'>
<Transform DEF='SPIKEcenter='0 -.1 0translation='0 .1 0'>
<Shape>
<Cone bottom='falsebottomRadius='.05height='.2'/>
<Appearance>
<Material diffuseColor='.8 .8 .8shininess='.5specularColor='.2 .2 .2'/>
</Appearance>
</Shape>
</Transform>
</Transform>
<Transform rotation='0 0 1 3.1416translation='0 -.49 0'>
<Transform USE='SPIKE'/>
</Transform>
<Transform rotation='0 0 1 -1.57079translation='.49 0 0'>
<Transform USE='SPIKE'/>
</Transform>
<Transform rotation='0 0 1 1.57079translation='-.49 0 0'>
<Transform USE='SPIKE'/>
</Transform>
<Transform rotation='1 0 0 1.57079translation='0 0 .49'>
<Transform USE='SPIKE'/>
</Transform>
<Transform rotation='1 0 0 -1.57079translation='0 0 -.49'>
<Transform USE='SPIKE'/>
</Transform>
<Shape>
<IndexedLineSet coordIndex='0 1 -1'>
<Coordinate DEF='UW_MINE_TETHER'>
<IS>
<connect nodeField='pointprotoField='tetherPoints'/>
</IS>
</Coordinate>
</IndexedLineSet>
</Shape>
</Group>
<!-- Medium resolution -->
<Group>
<Viewpoint DEF='UW_MINE_VIEWPOINT_MEDIUM'>
<IS>
<connect nodeField='descriptionprotoField='description'/>
</IS>
</Viewpoint>
<Shape USE='UW_MINE_SPHERE'/>
</Group>
<!-- Low resolution -->
<Shape>
<Box size='12 12 12'/>
<Appearance USE='UW_MINE_APPEARANCE'/>
</Shape>
<!-- No resolution -->
<WorldInfo info='"null geometry"'/>
</LOD>
</Transform>
</ProtoBody>
</ProtoDeclare>
<!-- Show default geometry, in case this Prototype library is viewed directly as a scene -->
<Group DEF='ShowSphericalMines'>
<!-- ROUTE information for BLUE_SPHERICAL_MINE node:  [from proximityIsActive to NAVIGATION_MODE.inProximity ] -->
<ProtoInstance name='SphericalMineDEF='BLUE_SPHERICAL_MINE'>
<fieldValue name='descriptionvalue='10 m: blue SphericalMine default viewpoint'/>
<fieldValue name='colorvalue='0 0 .8'/>
<fieldValue name='translationvalue='0 -10 0'/>
<fieldValue name='bboxCentervalue='1 1 1'/>
<fieldValue name='tetherPointsvalue='0 0 0 0 -10.0 0'/>
</ProtoInstance>
<!-- ROUTE information for GREEN_SPHERICAL_MINE node:  [from proximityIsActive to NAVIGATION_MODE.inProximity ] -->
<ProtoInstance name='SphericalMineDEF='GREEN_SPHERICAL_MINE'>
<fieldValue name='descriptionvalue='10 m: green SphericalMine default viewpoint'/>
<fieldValue name='colorvalue='0 .8 0'/>
<fieldValue name='translationvalue='10 -10 0'/>
<fieldValue name='bboxCentervalue='2 2 2'/>
<fieldValue name='tetherPointsvalue='0 0 0 0 -10.0 0'/>
</ProtoInstance>
<Background groundColor='0 .2 .2skyColor='0 .3 .3'/>
<Viewpoint description='1 m: one closeup SphericalMineposition='10 -10 2'/>
<Viewpoint description='10 m: two pointy SphericalMinesposition='5 -10 10'/>
<Viewpoint description='100+ m: two round SphericalMinesposition='5 -10 105'/>
<Viewpoint description='500+ m: two boxy SphericalMinesposition='5 -10 510'/>
<Viewpoint description='5000+ m: two invisible SphericalMinesposition='5 -10 5010'/>
</Group>
<!-- Proximity activation triggers switch in NavigationInfo mode between EXAMINE and WALK - pretty cool! -->
<!-- ROUTE information for NAVIGATION node:  [from NAVIGATION_MODE.type to set_type ] -->
<NavigationInfo DEF='NAVIGATIONspeed='20type='"WALK" "EXAMINE" "ANY"'/>
<!-- ROUTE information for NAVIGATION_MODE node:  [from BLUE_SPHERICAL_MINE.proximityIsActive to inProximity ] [from GREEN_SPHERICAL_MINE.proximityIsActive to inProximity ] [from type to NAVIGATION.set_type ] -->
<Script DEF='NAVIGATION_MODE'>
<field name='inProximitytype='SFBoolaccessType='inputOnly'/>
<field name='typetype='MFStringaccessType='outputOnly'/>
<![CDATA[
      
ecmascript:

function inProximity ( value, eventTime )
{
 if ( value == true )
 {
	type[0] = 'EXAMINE';
	type[1] = 'WALK';
	type[2] = 'ANY';
 }
 else
 {
	type[0] = 'WALK';
	type[1] = 'EXAMINE';
	type[2] = 'ANY';
 }
 // Browser.print ('inProximity=' + value + ', type=' + type);
}

    
]]>
</Script>
<ROUTE fromNode='BLUE_SPHERICAL_MINEfromField='proximityIsActivetoNode='NAVIGATION_MODEtoField='inProximity'/>
<ROUTE fromNode='GREEN_SPHERICAL_MINEfromField='proximityIsActivetoNode='NAVIGATION_MODEtoField='inProximity'/>
<ROUTE fromNode='NAVIGATION_MODEfromField='typetoNode='NAVIGATIONtoField='set_type'/>
</Scene>
</X3D>
<!--

Index for ProtoDeclare definition : SphericalMine

Index for DEF nodes : BLUE_SPHERICAL_MINE, GREEN_SPHERICAL_MINE, LOCATOR, NAVIGATION, NAVIGATION_MODE, ShowSphericalMines, SPIKE, UW_MINE_APPEARANCE, UW_MINE_MATERIAL, UW_MINE_PROXIMITY, UW_MINE_SPHERE, UW_MINE_TETHER, UW_MINE_VIEWPOINT, UW_MINE_VIEWPOINT_MEDIUM

Index for Viewpoint images : Viewpoint_1, Viewpoint_2, Viewpoint_3, Viewpoint_4, Viewpoint_5, UW_MINE_VIEWPOINT, UW_MINE_VIEWPOINT_MEDIUM
-->

<!-- Color key: <X3dNode DEF='idName' field='value'/> matches <XmlElement DEF='idName' attribute='value'/>
(Light blue background: behavior node) (Grey background: inserted documentation) (Magenta background: X3D Extensibility)
    <Prototype name='ProtoName'> <field name='fieldName'/> </Prototype> -->

<!-- For additional help information about X3D scenes, please see X3D Tooltips, X3D Resources and X3D Scene Authoring Hints. -->