package Savage.Submarines.Various;

import org.web3d.x3d.jsail.Core.*;
import org.web3d.x3d.jsail.EnvironmentalEffects.*;
import org.web3d.x3d.jsail.fields.*;
import org.web3d.x3d.jsail.Geometry3D.*;
import org.web3d.x3d.jsail.Grouping.*;
import org.web3d.x3d.jsail.Interpolation.*;
import org.web3d.x3d.jsail.Navigation.*;
import org.web3d.x3d.jsail.Networking.*;
import org.web3d.x3d.jsail.PointingDeviceSensor.*;
import org.web3d.x3d.jsail.Scripting.*;
import org.web3d.x3d.jsail.Shape.*;
import org.web3d.x3d.jsail.Sound.*;
import org.web3d.x3d.jsail.Time.*;

// Javadoc metadata annotations follow, see below for X3DJSAIL Java source code.
/**
 * <p> A Hellenic fleet submarine with animation capabilities. </p>
 <p> Related links: Catalog page <a href="../../../../Submarines/Various/Type209GlafkosDieselSubmarineAnimatedIndex.html" target="_blank">Type209GlafkosDieselSubmarineAnimated</a>,  source <a href="../../../../Submarines/Various/Type209GlafkosDieselSubmarineAnimated.java">Type209GlafkosDieselSubmarineAnimated.java</a>, <a href="https://www.web3d.org/x3d/content/examples/X3dResources.html" target="_blank">X3D Resources</a>, <a href="https://www.web3d.org/x3d/content/examples/X3dSceneAuthoringHints.html" target="_blank">X3D Scene Authoring Hints</a>, and <a href="https://www.web3d.org/x3d/content/X3dTooltips.html" target="_blank">X3D Tooltips</a>. </p>
	<table style="color:black; border:0px solid; border-spacing:10px 0px;">
        <caption>Scene Meta Information</caption>
		<tr style="background-color:silver; border-color:silver;">
			<td style="text-align:center; padding:10px 0px;"><i>meta tags</i></td>
			<td style="text-align:left;   padding:10px 0px;">&nbsp; Document Metadata </td>
		</tr>

		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> title </i> </td>
			<td> <a href="../../../../Submarines/Various/Type209GlafkosDieselSubmarineAnimated.x3d">Type209GlafkosDieselSubmarineAnimated.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> description </i> </td>
			<td> A Hellenic fleet submarine with animation capabilities. </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> creator </i> </td>
			<td> Anthony Varelas </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> created </i> </td>
			<td> 1 August 2002 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> modified </i> </td>
			<td> 28 November 2019 </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> reference </i> </td>
			<td> ArleighBurkePropeller.wrl Mk48.Torpedo.wrl HarpoonPrototype.wrl Radar3.wrl sonar.wav MISSILE.wav </td>
		</tr>
		<tr style="color:burntorange">
			<td style="text-align:right; vertical-align: text-top;"> <i> warning </i> </td>
			<td> Torpedoes and missiles need to get moved to submarine-independent coordinate system. </td>
		</tr>
		<tr style="color:burntorange">
			<td style="text-align:right; vertical-align: text-top;"> <i> warning </i> </td>
			<td> Inline Harpoon needs to get converted to Harpoon ExternPrototDeclare </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> identifier </i> </td>
			<td> <a href="https://www.web3d.org/x3d/content/examples/Savage/Submarines/Various/Type209GlafkosDieselSubmarineAnimated.x3d" target="_blank">https://www.web3d.org/x3d/content/examples/Savage/Submarines/Various/Type209GlafkosDieselSubmarineAnimated.x3d</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> generator </i> </td>
			<td> X3D-Edit 3.2, <a href="https://www.web3d.org/x3d/tools/X3D-Edit" target="_blank">https://www.web3d.org/x3d/tools/X3D-Edit</a> </td>
		</tr>
		<tr>
			<td style="text-align:right; vertical-align: text-top;"> <i> license </i> </td>
			<td> <a href="../../../../Submarines/Various/../../license.html">../../license.html</a> </td>
		</tr>
		<tr style="background-color:silver; border-color:silver;">
			<td style="text-align:center;" colspan="2">  &nbsp; </td>
		</tr>
	</table>

	<p>
		This program uses the
		<a href="https://www.web3d.org/specifications/java/X3DJSAIL.html" target="_blank">X3D Java Scene Access Interface Library (X3DJSAIL)</a>.
		It has been produced using the 
		<a href="https://www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank">X3dToJava.xslt</a>
		stylesheet
	       (<a href="https://sourceforge.net/p/x3d/code/HEAD/tree/www.web3d.org/x3d/stylesheets/X3dToJava.xslt" target="_blank">version control</a>)
                which is used to create Java source code from an original <code>.x3d</code> model.
	</p>

	* @author Anthony Varelas
 */

public class Type209GlafkosDieselSubmarineAnimated
{
	/** Default constructor to create this object. */
	public Type209GlafkosDieselSubmarineAnimated ()
	{
	  initialize();
	}

	/** Create and initialize the X3D model for this object. */
	public final void initialize()
	{
            try { // catch-all
  x3dModel = new X3D().setProfile(X3D.PROFILE_IMMERSIVE).setVersion(X3D.VERSION_3_0)
  .setHead(new head()
    .addMeta(new meta().setName(meta.NAME_TITLE      ).setContent("Type209GlafkosDieselSubmarineAnimated.x3d"))
    .addMeta(new meta().setName(meta.NAME_DESCRIPTION).setContent("A Hellenic fleet submarine with animation capabilities."))
    .addMeta(new meta().setName(meta.NAME_CREATOR    ).setContent("Anthony Varelas"))
    .addMeta(new meta().setName(meta.NAME_CREATED    ).setContent("1 August 2002"))
    .addMeta(new meta().setName(meta.NAME_MODIFIED   ).setContent("28 November 2019"))
    .addMeta(new meta().setName(meta.NAME_REFERENCE  ).setContent("ArleighBurkePropeller.wrl Mk48.Torpedo.wrl HarpoonPrototype.wrl Radar3.wrl sonar.wav MISSILE.wav"))
    .addMeta(new meta().setName(meta.NAME_WARNING    ).setContent("Torpedoes and missiles need to get moved to submarine-independent coordinate system."))
    .addMeta(new meta().setName(meta.NAME_WARNING    ).setContent("Inline Harpoon needs to get converted to Harpoon ExternPrototDeclare"))
    .addMeta(new meta().setName(meta.NAME_IDENTIFIER ).setContent("https://www.web3d.org/x3d/content/examples/Savage/Submarines/Various/Type209GlafkosDieselSubmarineAnimated.x3d"))
    .addMeta(new meta().setName(meta.NAME_GENERATOR  ).setContent("X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit"))
    .addMeta(new meta().setName(meta.NAME_LICENSE    ).setContent("../../license.html")))
  .setScene(new Scene()
    .addChild(new WorldInfo().setTitle("Type209GlafkosDieselSubmarineAnimated.x3d"))
    .addChild(new Background().setGroundAngle(new double[] {1.5708}).setGroundColor(new MFColor(new double[] {0.0,0.2,0.7,0.0,0.6,0.9})).setSkyAngle(new double[] {0.654,1.309}).setSkyColor(new MFColor(new double[] {1.0,1.0,1.0,0.0,0.5,1.0,0.0,0.5,1.0})))
    .addChild(new Viewpoint().setDescription("Far Right View").setFieldOfView(1.047).setPosition(1.5,-1.035,15.5))
    .addChild(new Viewpoint().setDescription("Close Right View").setPosition(0.0,-1.035,10.0))
    .addChild(new Viewpoint().setDescription("Tower View").setPosition(2.7,1.1,3.0))
    .addChild(new Viewpoint().setDescription("Rear View").setOrientation(0.0,1.0,0.0,-1.57).setPosition(-10.0,-0.83,0.0))
    .addChild(new Viewpoint().setDescription("Left View").setFieldOfView(1.047).setOrientation(0.0,1.0,0.0,3.14).setPosition(1.5,-1.035,-23.6))
    .addChild(new Viewpoint().setDescription("Front View").setOrientation(0.0,1.0,0.0,1.57).setPosition(11.0,-1.035,0.0))
    .addChild(new Viewpoint().setDescription("Top View").setFieldOfView(1.047).setOrientation(1.0,0.0,0.0,-1.57).setPosition(0.0,25.0,-3.9))
    .addChild(new Viewpoint().setDescription("Bottom View").setFieldOfView(1.047).setOrientation(1.0,0.0,0.0,1.57).setPosition(0.0,-27.0,-4.0))
    .addChild(new Viewpoint().setDescription("Right Side Launch View").setFieldOfView(1.047).setPosition(9.0,-1.035,15.5))
    .addChild(new Transform().setScale(0.8,0.8,0.8).setTranslation(1.5,-0.846,0.0)
      .addChild(new Group()
        .addChild(new Transform("Submarine").setCenter(0.0,0.0,-5.0)
          .addComments(" Construction of the Hull ")
          .addChild(new Transform("Hull").setCenter(0.0,0.42,0.0).setScale(1.0,1.3,1.0)
            .addChild(new Transform().setRotation(0.0,0.0,1.0,1.57)
              .addChild(new Shape()
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.0,0.0,0.0).setEmissiveColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                .setGeometry(new Cylinder().setHeight(12.375).setRadius(0.84))))
            .addChild(new Transform().setRotation(0.0,0.0,1.0,1.57).setTranslation(-6.184,0.0,0.0)
              .addChild(new Shape()
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                .setGeometry(new Extrusion().setBeginCap(false).setCreaseAngle(1.57).setCrossSection(new MFVec2f(new double[] {1.0,0.0,0.92,-0.38,0.71,-0.71,0.38,-0.92,0.0,-1.0,-0.38,-0.92,-0.71,-0.71,-0.92,-0.38,-1.0,0.0,-0.92,0.38,-0.71,0.71,-0.38,0.92,0.0,1.0,0.38,0.92,0.71,0.71,0.92,0.38,1.0,0.0})).setScale(new MFVec2f(new double[] {0.84,0.84,0.81,0.81,0.77,0.77,0.74,0.74,0.70,0.70,0.66,0.66,0.62,0.62,0.57,0.57,0.52,0.52,0.47,0.47,0.41,0.41,0.33,0.33,0.24,0.24,0.15,0.15,0.06,0.06})).setSpine(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,0.3,0.0,0.0,0.6,0.0,0.0,0.9,0.0,0.0,1.2,0.0,0.0,1.5,0.0,0.0,1.8,0.0,0.0,2.1,0.0,0.0,2.4,0.0,0.0,2.7,0.0,0.0,3.0,0.0,0.0,3.3,0.0,0.0,3.6,0.0,0.0,3.9,0.0,0.0,4.2,0.0})))))
            .addChild(new Transform().setScale(0.6,1.0,1.0).setTranslation(6.1875,0.0,0.0)
              .addChild(new Shape()
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                .setGeometry(new Sphere().setRadius(0.825))))
            .addChild(new Transform().setScale(7.63,0.53,0.5).setTranslation(-0.04,0.61,0.0)
              .addChild(new Shape()
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                .setGeometry(new Extrusion().setCreaseAngle(1.57).setCrossSection(new MFVec2f(new double[] {1.0,0.0,0.92,-0.38,0.71,-0.71,0.38,-0.92,0.0,-1.0,-0.38,-0.92,-0.71,-0.71,-0.92,-0.38,-1.0,-0.0,-0.92,0.38,-0.71,0.71,-0.38,0.92,0.0,1.0,0.38,0.92,0.71,0.71,0.92,0.38,1.0,0.0})).setScale(new MFVec2f(new double[] {0.815,0.94,0.815,0.92,0.815,0.90,0.815,0.88,0.815,0.86,0.815,0.84,0.815,0.82,0.8,0.8,0.78,0.78,0.76,0.76})).setSpine(new MFVec3f(new double[] {0.0,0.15,0.0,0.0,0.2,0.0,0.0,0.25,0.0,0.0,0.3,0.0,0.0,0.35,0.0,0.0,0.4,0.0,0.0,0.45,0.0,0.0,0.5,0.0,0.0,0.55,0.0,0.0,0.6,0.0}))))))
          .addComments(" Construction of the Tower ")
          .addChild(new Transform("Tower")
            .addChild(new Transform("TowerBody").setScale(5.357,1.0,1.0).setTranslation(0.84375,1.455,0.0)
              .addChild(new Shape()
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                .setGeometry(new Cylinder().setHeight(1.5).setRadius(0.28))))
            .addComments(" Construction of the Hatch ")
            .addChild(new Transform("Hatch")
              .addChild(new Transform("HatchBase").setTranslation(1.34,2.244,0.0)
                .addChild(new Shape()
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175)))
                  .setGeometry(new Cylinder().setHeight(0.08).setRadius(0.17))))
              .addChild(new Transform()
                .addChild(new Group("HatchCover")
                  .addChild(new Transform().setTranslation(1.33,2.2965,0.0)
                    .addChild(new Shape()
                      .setAppearance(new Appearance()
                        .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175)))
                      .setGeometry(new Cylinder().setHeight(0.0216).setRadius(0.189))))
                  .addChild(new Transform().setTranslation(1.438,2.2985,0.0)
                    .addChild(new Shape()
                      .setAppearance(new Appearance()
                        .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175)))
                      .setGeometry(new Box().setSize(0.216,0.0216,0.378))))
                  .addChild(new Transform().setRotation(1.0,0.0,0.0,1.57).setTranslation(1.5415,2.2904,0.0)
                    .addChild(new Shape()
                      .setAppearance(new Appearance()
                        .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175)))
                      .setGeometry(new Cylinder().setHeight(0.378).setRadius(0.027)))))))
            .addChild(new Transform("Radar")
              .addChild(new Transform().setTranslation(0.84375,3.001875,0.0)
                .addChild(new Shape()
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                  .setGeometry(new Cylinder().setHeight(1.59375).setRadius(0.0385))))
              .addChild(new Transform().setScale(0.1,0.1,0.1).setTranslation(0.84375,3.9,0.0)
                .addChild(new Inline().setUrl(new String[] {"SubmarineRadar.x3d","https://www.web3d.org/x3d/content/examples/Savage/Submarines/Various/SubmarineRadar.x3d","SubmarineRadar.wrl","https://www.web3d.org/x3d/content/examples/Savage/Submarines/Various/SubmarineRadar.wrl"}))))
            .addComments(" Construction of Snorkelling device ")
            .addChild(new Transform("Snorkelling").setTranslation(0.4,2.908125,0.0)
              .addChild(new Transform("SnorkellingTube")
                .addChild(new Shape()
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                  .setGeometry(new Cylinder().setHeight(1.40625).setRadius(0.09))))
              .addChild(new Transform("SnorkellingCover").setScale(0.49,0.65,0.49).setTranslation(-0.66,-0.79,0.0)
                .addChild(new Group().setUSE("HatchCover"))))
            .addComments(" Construction of Periscope #1 ")
            .addChild(new Transform("Periscope1")
              .addChild(new Transform().setTranslation(2.0,2.7675,0.0)
                .addChild(new Shape()
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                  .setGeometry(new Cylinder().setHeight(1.125).setRadius(0.025))))
              .addChild(new Transform().setTranslation(2.0,3.25,0.0)
                .addChild(new Shape("PeriscopeTop")
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                  .setGeometry(new Cylinder().setHeight(0.1).setRadius(0.04))))
              .addChild(new Transform().setRotation(1.0,0.0,0.0,1.57).setTranslation(2.0,3.25,0.0)
                .addChild(new Shape("PeriscopeLens")
                  .setAppearance(new Appearance()
                    .setMaterial(new Material()))
                  .setGeometry(new Cylinder().setHeight(0.08).setRadius(0.028)))))
            .addComments(" Construction of Periscope #2 ")
            .addChild(new Transform("Periscope2")
              .addChild(new Transform().setTranslation(1.7,3.001875,0.0)
                .addChild(new Shape()
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                  .setGeometry(new Cylinder().setHeight(1.59375).setRadius(0.025))))
              .addChild(new Transform().setTranslation(1.7,3.72,0.0)
                .addChild(new Shape().setUSE("PeriscopeTop")))
              .addChild(new Transform().setRotation(1.0,0.0,0.0,1.57).setTranslation(1.7,3.72,0.0)
                .addChild(new Shape().setUSE("PeriscopeLens"))))
            .addChild(new Transform()
              .addChild(new Transform().setTranslation(1.0175,2.865,0.15)
                .addChild(new Shape()
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                  .setGeometry(new Cylinder().setHeight(1.32).setRadius(0.025))))
              .addChild(new Transform().setTranslation(1.0175,3.55,0.15)
                .addChild(new Shape()
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                  .setGeometry(new Cylinder().setHeight(0.1).setRadius(0.016)))))
            .addChild(new Transform()
              .addChild(new Transform().setTranslation(0.67,2.865,0.15)
                .addChild(new Shape()
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                  .setGeometry(new Cylinder().setHeight(1.32).setRadius(0.025))))
              .addChild(new Transform().setTranslation(0.67,3.55,0.15)
                .addChild(new Shape()
                  .setAppearance(new Appearance()
                    .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                  .setGeometry(new Cylinder().setHeight(0.1).setRadius(0.016))))))
          .addComments(" Construction of the Rudders ")
          .addChild(new Transform("Rudders")
            .addChild(new Transform().setRotation(1.0,0.0,0.0,1.57).setScale(0.7,1.0,0.1).setTranslation(-9.5,0.0,0.57)
              .addChild(new Shape("RightRudder")
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                .setGeometry(new Cylinder().setHeight(0.8).setRadius(0.4))))
            .addChild(new Transform().setTranslation(-9.9,0.0,0.545)
              .addChild(new Shape("RightRudderBlade")
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                .setGeometry(new Box().setSize(0.235,0.05,0.85))))
            .addChild(new Transform().setRotation(1.0,0.0,0.0,-1.57).setScale(0.7,1.0,0.1).setTranslation(-9.5,0.0,-0.57)
              .addChild(new Shape().setUSE("RightRudder")))
            .addChild(new Transform().setTranslation(-9.9,0.0,-0.545)
              .addChild(new Shape().setUSE("RightRudderBlade")))
            .addChild(new Transform().setScale(1.0,1.0,0.133).setTranslation(-9.72,0.5,0.0)
              .addChild(new Shape("UpperRudder")
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                .setGeometry(new Cylinder().setHeight(0.8).setRadius(0.3))))
            .addChild(new Transform().setScale(1.0,1.0,0.114).setTranslation(-9.67,-0.5,0.0)
              .addChild(new Shape("DownRudder")
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                .setGeometry(new Cylinder().setHeight(0.6).setRadius(0.35)))))
          .addComments(" Construction of the Stabilizers ")
          .addChild(new Transform("Stabilizers")
            .addChild(new Transform().setScale(1.0,1.0,2.0).setTranslation(5.2,-0.42,0.42)
              .addChild(new Shape("RightStabilizer")
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                .setGeometry(new Cylinder().setHeight(0.05).setRadius(0.46875))))
            .addChild(new Transform().setScale(1.0,1.0,2.0).setTranslation(5.2,-0.42,-0.42)
              .addChild(new Shape("LeftStabilizer")
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.15,0.175,0.175).setSpecularColor(0.2,0.2,0.2)))
                .setGeometry(new Cylinder().setHeight(0.05).setRadius(0.46875)))))
          .addComments(" Inline the Propeller ")
          .addChild(new Transform("Propeller").setRotation(0.0,1.0,0.0,-1.57).setScale(0.2,0.2,0.2).setTranslation(-10.5,-0.12,0.0)
            .addChild(new Inline().setUrl(new String[] {"Type209GlafkosDieselSubmarinePropeller.x3d","https://www.web3d.org/x3d/content/examples/Savage/Submarines/Various/Type209GlafkosDieselSubmarinePropeller.x3d","Type209GlafkosDieselSubmarinePropeller.wrl","https://www.web3d.org/x3d/content/examples/Savage/Submarines/Various/Type209GlafkosDieselSubmarinePropeller.wrl"})))
          .addComments(" Weapons ")
          .addChild(new Transform("Torpedoes-Harpoons")
            .addChild(new Transform("TorpedoSet1").setRotation(0.0,0.0,1.0,-1.57).setTranslation(5.522,-0.2,-0.3)
              .addChild(new Shape("TorpedoTube1")
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.18,0.15,0.15)))
                .setGeometry(new Cylinder().setHeight(2.282).setRadius(0.09)))
              .addChild(new Transform("Torpedo1")
                .addChild(new Transform().setRotation(0.0,0.0,1.0,1.57).setScale(0.32,0.32,0.32).setTranslation(0.0,0.18,0.0)
                  .addChild(new Inline("Mk48Torpedo").setUrl(new String[] {"../../Weapons/Torpedoes/Mk48Torpedo.x3d","https://www.web3d.org/x3d/content/examples/Savage/Weapons/Torpedoes/Mk48Torpedo.x3d","../../Weapons/Torpedoes/Mk48Torpedo.wrl","https://www.web3d.org/x3d/content/examples/Savage/Weapons/Torpedoes/Mk48Torpedo.wrl"}))
                  .addChild(new Transform().setRotation(0.0,0.0,1.0,1.57).setTranslation(-1.872,0.0,0.0)
                    .addChild(new Shape()
                      .setAppearance(new Appearance()
                        .setMaterial(new Material().setEmissiveColor(0.18,0.18,0.18)))
                      .setGeometry(new Cylinder().setHeight(1.3).setRadius(0.267)))))))
            .addChild(new Transform("TorpedoSet2").setRotation(0.0,0.0,1.0,-1.57).setTranslation(5.522,-0.2,0.3)
              .addChild(new Shape("TorpedoTube2")
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.18,0.15,0.15)))
                .setGeometry(new Cylinder().setHeight(2.282).setRadius(0.09)))
              .addChild(new Transform("Torpedo2")
                .addChild(new Transform().setRotation(0.0,0.0,1.0,1.57).setScale(0.32,0.32,0.32).setTranslation(0.0,0.18,0.0)
                  .addChild(new Inline().setUSE("Mk48Torpedo"))
                  .addChild(new Transform().setRotation(0.0,0.0,1.0,1.57).setTranslation(-1.872,0.0,0.0)
                    .addChild(new Shape()
                      .setAppearance(new Appearance()
                        .setMaterial(new Material().setEmissiveColor(0.18,0.18,0.18)))
                      .setGeometry(new Cylinder().setHeight(1.3).setRadius(0.267)))))))
            .addChild(new Transform("TorpedoSet3").setRotation(0.0,0.0,1.0,-1.57).setTranslation(5.496,-0.4,-0.35)
              .addChild(new Shape("TorpedoTube3")
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.18,0.15,0.15)))
                .setGeometry(new Cylinder().setHeight(2.282).setRadius(0.09)))
              .addChild(new Transform("Torpedo3")
                .addChild(new Transform().setRotation(0.0,0.0,1.0,1.57).setScale(0.32,0.32,0.32).setTranslation(0.0,0.18,0.0)
                  .addChild(new Inline().setUSE("Mk48Torpedo"))
                  .addChild(new Transform().setRotation(0.0,0.0,1.0,1.57).setTranslation(-1.872,0.0,0.0)
                    .addChild(new Shape()
                      .setAppearance(new Appearance()
                        .setMaterial(new Material().setEmissiveColor(0.18,0.18,0.18)))
                      .setGeometry(new Cylinder().setHeight(1.3).setRadius(0.267)))))))
            .addChild(new Transform("TorpedoSet4").setRotation(0.0,0.0,1.0,-1.57).setTranslation(5.496,-0.4,0.35)
              .addChild(new Shape("TorpedoTube4")
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.18,0.15,0.15)))
                .setGeometry(new Cylinder().setHeight(2.282).setRadius(0.09)))
              .addChild(new Transform("Torpedo4")
                .addChild(new Transform().setRotation(0.0,0.0,1.0,1.57).setScale(0.32,0.32,0.32).setTranslation(0.0,0.18,0.0)
                  .addChild(new Inline().setUSE("Mk48Torpedo"))
                  .addChild(new Transform().setRotation(0.0,0.0,1.0,1.57).setTranslation(-1.872,0.0,0.0)
                    .addChild(new Shape()
                      .setAppearance(new Appearance()
                        .setMaterial(new Material().setEmissiveColor(0.18,0.18,0.18)))
                      .setGeometry(new Cylinder().setHeight(1.3).setRadius(0.267)))))))
            .addChild(new Transform("TorpedoSet5").setRotation(0.0,0.0,1.0,-1.57).setTranslation(5.528,-0.4,-0.126)
              .addChild(new Shape("TorpedoTube5")
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.18,0.15,0.15)))
                .setGeometry(new Cylinder().setHeight(2.282).setRadius(0.09)))
              .addChild(new Transform("Torpedo5")
                .addChild(new Transform().setRotation(0.0,0.0,1.0,1.57).setScale(0.32,0.32,0.32).setTranslation(0.0,0.18,0.0)
                  .addChild(new Inline().setUSE("Mk48Torpedo"))
                  .addChild(new Transform().setRotation(0.0,0.0,1.0,1.57).setTranslation(-1.872,0.0,0.0)
                    .addChild(new Shape()
                      .setAppearance(new Appearance()
                        .setMaterial(new Material().setEmissiveColor(0.18,0.18,0.18)))
                      .setGeometry(new Cylinder().setHeight(1.3).setRadius(0.267)))))))
            .addChild(new Transform("TorpedoSet6").setRotation(0.0,0.0,1.0,-1.57).setTranslation(5.528,-0.4,0.126)
              .addChild(new Shape("TorpedoTube6")
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.18,0.15,0.15)))
                .setGeometry(new Cylinder().setHeight(2.282).setRadius(0.09)))
              .addChild(new Transform("Torpedo6")
                .addChild(new Transform().setRotation(0.0,0.0,1.0,1.57).setScale(0.32,0.32,0.32).setTranslation(0.0,0.18,0.0)
                  .addChild(new Inline().setUSE("Mk48Torpedo"))
                  .addChild(new Transform().setRotation(0.0,0.0,1.0,1.57).setTranslation(-1.872,0.0,0.0)
                    .addChild(new Shape()
                      .setAppearance(new Appearance()
                        .setMaterial(new Material().setEmissiveColor(0.18,0.18,0.18)))
                      .setGeometry(new Cylinder().setHeight(1.3).setRadius(0.267)))))))
            .addChild(new Transform("HarpoonSet1").setRotation(0.0,0.0,1.0,-1.57).setTranslation(5.528,0.0,-0.25)
              .addChild(new Shape("HarpoonTube1")
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.18,0.15,0.15)))
                .setGeometry(new Cylinder().setHeight(2.282).setRadius(0.09)))
              .addChild(new Transform("Harpoon1").setScale(0.1,0.1,0.1).setTranslation(0.0,1.08,0.0)
                .addChild(new Inline("Harpoon").setUrl(new String[] {"../../Weapons/Missiles/HarpoonExample.x3d","https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/HarpoonExample.x3d","../../Weapons/Missiles/HarpoonExample.wrl","https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/HarpoonExample.wrl"}))))
            .addChild(new Transform("HarpoonSet2").setRotation(0.0,0.0,1.0,-1.57).setTranslation(5.528,0.0,0.25)
              .addChild(new Shape("HarpoonTube2")
                .setAppearance(new Appearance()
                  .setMaterial(new Material().setDiffuseColor(0.18,0.15,0.15)))
                .setGeometry(new Cylinder().setHeight(2.282).setRadius(0.09)))
              .addChild(new Transform("Harpoon2").setScale(0.1,0.1,0.1).setTranslation(0.0,1.08,0.0)
                .addChild(new Inline().setUSE("Harpoon"))))))
        .addComments(" Main Sensors ")
        .addChild(new PlaneSensor("SubDrag").setDescription("click and drag to move object"))
        .addChild(new TouchSensor("Touch1").setDescription("touch to activate"))
        .addChild(new TimeSensor("Clock").setCycleInterval(50).setLoop(true))
        .addComments(" Itinerary of the submarine ")
        .addChild(new Script("SubMove").setSourceCode("""
ecmascript:

function set_fraction (fraction,eventTime) 
{
 value_changed[0]=radius*Math.sin(turns*fraction*6.28);
 value_changed[1]=0;
 value_changed[2]=radius*Math.cos(turns*fraction*6.28)
}
""")
          .addField(new field().setName("set_fraction").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTONLY))
          .addField(new field().setName("value_changed").setType(field.TYPE_SFVEC3F).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
          .addField(new field().setName("radius").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setValue(10))
          .addField(new field().setName("turns").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setValue(1)))
        .addChild(new Script("SubTurn").setSourceCode("""
ecmascript:

function set_fraction (fraction,eventTime)
{
 value_changed[0]=0;
 value_changed[1]=1;
 value_changed[2]=0;
 value_changed[3]=fraction*6.28;
}
""")
          .addField(new field().setName("set_fraction").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INPUTONLY))
          .addField(new field().setName("value_changed").setType(field.TYPE_SFROTATION).setAccessType(field.ACCESSTYPE_OUTPUTONLY))
          .addField(new field().setName("radius").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setValue(1))
          .addField(new field().setName("turns").setType(field.TYPE_SFFLOAT).setAccessType(field.ACCESSTYPE_INITIALIZEONLY).setValue(1)))
        .addChild(new Fog().setColor(0.0,0.0,1.0).setFogType("EXPONENTIAL").setVisibilityRange(150000))
        .addComments(" Sonar Sound ")
        .addChild(new Sound().setIntensity(0.6).setMaxBack(100).setMaxFront(100).setMinBack(50).setMinFront(50)
          .setSource(new AudioClip("SonarSound").setDescription("Sonar sound").setLoop(true).setUrl(new String[] {".../.../Submarines/Various/sonar.wav","https://www.web3d.org/x3d/content/examples/Savage/Submarines/Various/sonar.wav","sonar.wav"})))
        .addComments(" Launch Torpedoes-Missiles ")
        .addChild(new Group()
          .addChild(new Transform().setTranslation(1.5,-5.2,7.0)
            .addChild(new Shape()
              .setAppearance(new Appearance("TorpedoButton")
                .setMaterial(new Material().setDiffuseColor(0.25,0.0,0.75)))
              .setGeometry(new Sphere().setRadius(0.2)))
            .addChild(new TouchSensor("TorpedoLaunch1").setDescription("touch to activate")))
          .addChild(new Transform().setTranslation(2.5,-5.2,7.0)
            .addChild(new Shape()
              .setAppearance(new Appearance().setUSE("TorpedoButton"))
              .setGeometry(new Sphere().setRadius(0.2)))
            .addChild(new TouchSensor("TorpedoLaunch2").setDescription("touch to activate")))
          .addChild(new Transform().setTranslation(3.5,-5.2,7.0)
            .addChild(new Shape()
              .setAppearance(new Appearance().setUSE("TorpedoButton"))
              .setGeometry(new Sphere().setRadius(0.2)))
            .addChild(new TouchSensor("TorpedoLaunch3").setDescription("touch to activate")))
          .addChild(new Transform().setTranslation(4.5,-5.2,7.0)
            .addChild(new Shape()
              .setAppearance(new Appearance().setUSE("TorpedoButton"))
              .setGeometry(new Sphere().setRadius(0.2)))
            .addChild(new TouchSensor("TorpedoLaunch4").setDescription("touch to activate")))
          .addChild(new Transform().setTranslation(5.5,-5.2,7.0)
            .addChild(new Shape()
              .setAppearance(new Appearance().setUSE("TorpedoButton"))
              .setGeometry(new Sphere().setRadius(0.2)))
            .addChild(new TouchSensor("TorpedoLaunch5").setDescription("touch to activate")))
          .addChild(new Transform().setTranslation(6.5,-5.2,7.0)
            .addChild(new Shape()
              .setAppearance(new Appearance().setUSE("TorpedoButton"))
              .setGeometry(new Sphere().setRadius(0.2)))
            .addChild(new TouchSensor("TorpedoLaunch6").setDescription("touch to activate")))
          .addChild(new Transform().setTranslation(7.5,-5.2,7.0)
            .addChild(new Shape()
              .setAppearance(new Appearance("HarpoonButton")
                .setMaterial(new Material().setDiffuseColor(0.9,0.9,0.9)))
              .setGeometry(new Sphere().setRadius(0.2)))
            .addChild(new TouchSensor("HarpoonLaunch1").setDescription("touch to activate"))
            .addChild(new Sound().setIntensity(0.7).setMaxBack(100).setMaxFront(100).setMinBack(50).setMinFront(50)
              .setSource(new AudioClip("MissileSound1").setDescription("Missile sound").setUrl(new String[] {"../../Weapons/Missiles/MISSILE1.wav","https://www.web3d.org/x3d/content/examples/Savage/Weapons/Missiles/MISSILE1.wav","MISSILE1.wav"}))))
          .addChild(new Transform().setTranslation(8.5,-5.2,7.0)
            .addChild(new Shape()
              .setAppearance(new Appearance().setUSE("HarpoonButton"))
              .setGeometry(new Sphere().setRadius(0.2)))
            .addChild(new TouchSensor("HarpoonLaunch2").setDescription("touch to activate")))
          .addComments(" TimeSensors for Torpedoes-Missiles ")
          .addChild(new TimeSensor("Clock1").setCycleInterval(12).setEnabled(false).setLoop(true))
          .addChild(new TimeSensor("Clock2").setCycleInterval(12).setEnabled(false).setLoop(true))
          .addChild(new TimeSensor("Clock3").setCycleInterval(12).setEnabled(false).setLoop(true))
          .addChild(new TimeSensor("Clock4").setCycleInterval(12).setEnabled(false).setLoop(true))
          .addChild(new TimeSensor("Clock5").setCycleInterval(12).setEnabled(false).setLoop(true))
          .addChild(new TimeSensor("Clock6").setCycleInterval(12).setEnabled(false).setLoop(true))
          .addChild(new TimeSensor("Clock7").setCycleInterval(8).setEnabled(false).setLoop(true))
          .addChild(new TimeSensor("Clock8").setCycleInterval(8).setEnabled(false).setLoop(true))
          .addComments(" PositionInterpolators for Torpedoes ")
          .addChild(new PositionInterpolator("TorpedoFire1").setKey(new double[] {0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}).setKeyValue(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,4.0,0.0,0.0,8.0,0.0,0.0,12.0,0.0,0.0,16.0,0.0,0.0,20.0,0.0,0.0,24.0,0.0,0.0,28.0,0.0,0.0,32.0,0.0,0.0,36.0,0.0,0.0,40.0,0.0})))
          .addChild(new PositionInterpolator("TorpedoFire2").setKey(new double[] {0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}).setKeyValue(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,4.0,0.0,0.0,8.0,0.0,0.0,12.0,0.0,0.0,16.0,0.0,0.0,20.0,0.0,0.0,24.0,0.0,0.0,28.0,0.0,0.0,32.0,0.0,0.0,36.0,0.0,0.0,40.0,0.0})))
          .addChild(new PositionInterpolator("TorpedoFire3").setKey(new double[] {0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}).setKeyValue(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,4.0,0.0,0.0,8.0,0.0,0.0,12.0,0.0,0.0,16.0,0.0,0.0,20.0,0.0,0.0,24.0,0.0,0.0,28.0,0.0,0.0,32.0,0.0,0.0,36.0,0.0,0.0,40.0,0.0})))
          .addChild(new PositionInterpolator("TorpedoFire4").setKey(new double[] {0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}).setKeyValue(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,4.0,0.0,0.0,8.0,0.0,0.0,12.0,0.0,0.0,16.0,0.0,0.0,20.0,0.0,0.0,24.0,0.0,0.0,28.0,0.0,0.0,32.0,0.0,0.0,36.0,0.0,0.0,40.0,0.0})))
          .addChild(new PositionInterpolator("TorpedoFire5").setKey(new double[] {0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}).setKeyValue(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,4.0,0.0,0.0,8.0,0.0,0.0,12.0,0.0,0.0,16.0,0.0,0.0,20.0,0.0,0.0,24.0,0.0,0.0,28.0,0.0,0.0,32.0,0.0,0.0,36.0,0.0,0.0,40.0,0.0})))
          .addChild(new PositionInterpolator("TorpedoFire6").setKey(new double[] {0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}).setKeyValue(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,4.0,0.0,0.0,8.0,0.0,0.0,12.0,0.0,0.0,16.0,0.0,0.0,20.0,0.0,0.0,24.0,0.0,0.0,28.0,0.0,0.0,32.0,0.0,0.0,36.0,0.0,0.0,40.0,0.0})))
          .addComments(" PositionInterpolators for Missiles ")
          .addChild(new PositionInterpolator("HarpoonFire1").setKey(new double[] {0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}).setKeyValue(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,4.0,0.0,0.0,8.0,0.0,0.0,12.0,0.0,-1.0,16.0,0.0,-3.0,20.0,0.0,-6.0,24.0,0.0,-10.0,28.0,0.0,-15.0,32.0,0.0,-21.0,36.0,0.0,-28.0,40.0,0.0})))
          .addChild(new PositionInterpolator("HarpoonFire2").setKey(new double[] {0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}).setKeyValue(new MFVec3f(new double[] {0.0,0.0,0.0,0.0,4.0,0.0,0.0,8.0,0.0,0.0,12.0,0.0,-1.0,16.0,0.0,-3.0,20.0,0.0,-6.0,24.0,0.0,-10.0,28.0,0.0,-15.0,32.0,0.0,-21.0,36.0,0.0,-28.0,40.0,0.0})))
          .addComments(" OrientationInterpolators for Missiles ")
          .addChild(new OrientationInterpolator("HarpoonRot1").setKey(new double[] {0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}).setKeyValue(new MFRotation(new double[] {0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.112,0.0,0.0,1.0,0.224,0.0,0.0,1.0,0.449,0.0,0.0,1.0,0.673,0.0,0.0,1.0,0.897,0.0,0.0,1.0,1.121,0.0,0.0,1.0,1.346,0.0,0.0,1.0,1.57})))
          .addChild(new OrientationInterpolator("HarpoonRot2").setKey(new double[] {0.0,0.1,0.2,0.3,0.4,0.5,0.6,0.7,0.8,0.9,1.0}).setKeyValue(new MFRotation(new double[] {0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.0,0.0,0.0,1.0,0.112,0.0,0.0,1.0,0.224,0.0,0.0,1.0,0.449,0.0,0.0,1.0,0.673,0.0,0.0,1.0,0.897,0.0,0.0,1.0,1.121,0.0,0.0,1.0,1.346,0.0,0.0,1.0,1.57}))))
        .addComments(" Missile Sound ")
        .addChild(new ROUTE().setFromNode("HarpoonLaunch1").setFromField("touchTime").setToNode("MissileSound1").setToField("set_startTime"))
        .addChild(new ROUTE().setFromNode("HarpoonLaunch2").setFromField("touchTime").setToNode("MissileSound1").setToField("set_startTime"))
        .addComments(" Launch Torpedo #1 ")
        .addChild(new ROUTE().setFromNode("TorpedoLaunch1").setFromField("isOver").setToNode("Clock1").setToField("set_enabled"))
        .addChild(new ROUTE().setFromNode("Clock1").setFromField("fraction_changed").setToNode("TorpedoFire1").setToField("set_fraction"))
        .addChild(new ROUTE().setFromNode("TorpedoFire1").setFromField("value_changed").setToNode("Torpedo1").setToField("set_translation"))
        .addComments(" Launch Torpedo #2 ")
        .addChild(new ROUTE().setFromNode("TorpedoLaunch2").setFromField("isOver").setToNode("Clock2").setToField("set_enabled"))
        .addChild(new ROUTE().setFromNode("Clock2").setFromField("fraction_changed").setToNode("TorpedoFire2").setToField("set_fraction"))
        .addChild(new ROUTE().setFromNode("TorpedoFire2").setFromField("value_changed").setToNode("Torpedo2").setToField("set_translation"))
        .addComments(" Launch Torpedo #3 ")
        .addChild(new ROUTE().setFromNode("TorpedoLaunch3").setFromField("isOver").setToNode("Clock3").setToField("set_enabled"))
        .addChild(new ROUTE().setFromNode("Clock3").setFromField("fraction_changed").setToNode("TorpedoFire3").setToField("set_fraction"))
        .addChild(new ROUTE().setFromNode("TorpedoFire3").setFromField("value_changed").setToNode("Torpedo3").setToField("set_translation"))
        .addComments(" Launch Torpedo #4 ")
        .addChild(new ROUTE().setFromNode("TorpedoLaunch4").setFromField("isOver").setToNode("Clock4").setToField("set_enabled"))
        .addChild(new ROUTE().setFromNode("Clock4").setFromField("fraction_changed").setToNode("TorpedoFire4").setToField("set_fraction"))
        .addChild(new ROUTE().setFromNode("TorpedoFire4").setFromField("value_changed").setToNode("Torpedo4").setToField("set_translation"))
        .addComments(" Launch Torpedo #5 ")
        .addChild(new ROUTE().setFromNode("TorpedoLaunch5").setFromField("isOver").setToNode("Clock5").setToField("set_enabled"))
        .addChild(new ROUTE().setFromNode("Clock5").setFromField("fraction_changed").setToNode("TorpedoFire5").setToField("set_fraction"))
        .addChild(new ROUTE().setFromNode("TorpedoFire5").setFromField("value_changed").setToNode("Torpedo5").setToField("set_translation"))
        .addComments(" Launch Torpedo #6 ")
        .addChild(new ROUTE().setFromNode("TorpedoLaunch6").setFromField("isOver").setToNode("Clock6").setToField("set_enabled"))
        .addChild(new ROUTE().setFromNode("Clock6").setFromField("fraction_changed").setToNode("TorpedoFire6").setToField("set_fraction"))
        .addChild(new ROUTE().setFromNode("TorpedoFire6").setFromField("value_changed").setToNode("Torpedo6").setToField("set_translation"))
        .addComments(" Launch Harpoon #1 ")
        .addChild(new ROUTE().setFromNode("HarpoonLaunch1").setFromField("isOver").setToNode("Clock7").setToField("set_enabled"))
        .addChild(new ROUTE().setFromNode("Clock7").setFromField("fraction_changed").setToNode("HarpoonFire1").setToField("set_fraction"))
        .addChild(new ROUTE().setFromNode("HarpoonFire1").setFromField("value_changed").setToNode("Harpoon1").setToField("set_translation"))
        .addChild(new ROUTE().setFromNode("Clock7").setFromField("fraction_changed").setToNode("HarpoonRot1").setToField("set_fraction"))
        .addChild(new ROUTE().setFromNode("HarpoonRot1").setFromField("value_changed").setToNode("Harpoon1").setToField("set_rotation"))
        .addComments(" Launch Harpoon #2 ")
        .addChild(new ROUTE().setFromNode("HarpoonLaunch2").setFromField("isOver").setToNode("Clock8").setToField("set_enabled"))
        .addChild(new ROUTE().setFromNode("Clock8").setFromField("fraction_changed").setToNode("HarpoonFire2").setToField("set_fraction"))
        .addChild(new ROUTE().setFromNode("HarpoonFire2").setFromField("value_changed").setToNode("Harpoon2").setToField("set_translation"))
        .addChild(new ROUTE().setFromNode("Clock8").setFromField("fraction_changed").setToNode("HarpoonRot2").setToField("set_fraction"))
        .addChild(new ROUTE().setFromNode("HarpoonRot2").setFromField("value_changed").setToNode("Harpoon2").setToField("set_rotation")))
      .addComments(" Drag the Submarine ")
      .addChild(new ROUTE().setFromNode("SubDrag").setFromField("translation_changed").setToNode("Submarine").setToField("set_translation"))
      .addComments(" Moving the Submarine using the main TouchSensor ")
      .addChild(new ROUTE().setFromNode("Touch1").setFromField("touchTime").setToNode("Clock").setToField("set_startTime"))
      .addChild(new ROUTE().setFromNode("Clock").setFromField("fraction_changed").setToNode("SubMove").setToField("set_fraction"))
      .addChild(new ROUTE().setFromNode("SubMove").setFromField("value_changed").setToNode("Submarine").setToField("set_translation"))
      .addChild(new ROUTE().setFromNode("Clock").setFromField("fraction_changed").setToNode("SubTurn").setToField("set_fraction"))
      .addChild(new ROUTE().setFromNode("SubTurn").setFromField("value_changed").setToNode("Submarine").setToField("set_rotation"))));
            }
            catch (Exception ex)
            {       
                System.err.println ("*** Further hints on X3DJSAIL errors and exceptions at");
                System.err.println ("*** https://www.web3d.org/specifications/java/X3DJSAIL.html");
                throw (ex);
            }
	}
	// end of initialize() method

	/** The initialized model object, created within initialize() method. */
	private X3D x3dModel;

	/** 
	 * Provide a 
	 * <a href="https://dzone.com/articles/java-copy-shallow-vs-deep-in-which-you-will-swim" target="_blank">shallow copy</a>
	 * of the X3D model.
	 * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3D.html">X3D</a>
	 * @return Type209GlafkosDieselSubmarineAnimated model
	 */
	public X3D getX3dModel()
	{	  
		return x3dModel;
	}
	   
    /** 
     * Default main() method provided for test purposes, uses CommandLine to set global ConfigurationProperties for this object.
     * @param args array of input parameters, provided as arguments
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3D.html#handleArguments-java.lang.String:A-">X3D.handleArguments(args)</a>
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/Core/X3D.html#validationReport--">X3D.validationReport()</a>
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/CommandLine.html">CommandLine</a>
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/CommandLine.html#USAGE">CommandLine.USAGE</a>
     * @see <a href="https://www.web3d.org/specifications/java/javadoc/org/web3d/x3d/jsail/ConfigurationProperties.html">ConfigurationProperties</a>
     */
    public static void main(String args[])
    {
        System.out.println("Build this X3D model, showing validation diagnostics...");
        X3D thisExampleX3dModel = new Type209GlafkosDieselSubmarineAnimated().getX3dModel();
//      System.out.println("X3D model construction complete.");
	
        // next handle command line arguments
        boolean hasArguments = (args != null) && (args.length > 0);
        boolean validate = true; // default
        boolean argumentsLoadNewModel = false;
        String  fileName = new String();

        if (args != null)
        {
                for (String arg : args)
                {
                        if (arg.toLowerCase().startsWith("-v") || arg.toLowerCase().contains("validate"))
                        {
                                validate = true; // making sure
                        }
                        if (arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_X3D) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_CLASSICVRML) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_X3DB) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_VRML97) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_EXI) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_GZIP) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_ZIP) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_HTML) ||
                                arg.toLowerCase().endsWith(X3D.FILE_EXTENSION_XHTML))
                        {
                                argumentsLoadNewModel = true;
                                fileName = arg;
                        }
                }
        }
        if      (argumentsLoadNewModel)
                System.out.println("WARNING: \"Savage.Submarines.Various.Type209GlafkosDieselSubmarineAnimated\" model invocation is attempting to load file \"" + fileName + "\" instead of simply validating itself... file loading ignored.");
        else if (hasArguments) // if no arguments provided, this method produces usage warning
                thisExampleX3dModel.handleArguments(args);
	
        if (validate)
        {
            //  System.out.println("--- TODO fix duplicated outputs ---"); // omit when duplicated outputs problem is solved/refactored
		String validationResults = thisExampleX3dModel.validationReport();
            //  System.out.println("-----------------------------------"); // omit when duplicated outputs problem is solved/refactored
                System.out.print("Savage.Submarines.Various.Type209GlafkosDieselSubmarineAnimated self-validation test confirmation: ");
                if (!validationResults.equals("success"))
                    System.out.println();
                System.out.println(validationResults.trim());

                // experimental: test X3DJSAIL output files
                // Submarines/Various/Type209GlafkosDieselSubmarineAnimated_JavaExport.* file validation is checked when building X3D Example Archives
                String filenameX3D  = "Submarines/Various/Type209GlafkosDieselSubmarineAnimated_JavaExport.x3d"; 
                String filenameX3DV = "Submarines/Various/Type209GlafkosDieselSubmarineAnimated_JavaExport.x3dv"; 
                String filenameJSON = "Submarines/Various/Type209GlafkosDieselSubmarineAnimated_JavaExport.json";
                thisExampleX3dModel.toFileX3D        (filenameX3D);
                thisExampleX3dModel.toFileClassicVRML(filenameX3DV);
// TODO         thisExampleX3dModel.toFileJSON       (filenameJSON);
        }
    }
}
