{ "X3D": {
    "encoding":"UTF-8",
    "@profile":"Immersive",
    "@version":"3.2",
    "@xsd:noNamespaceSchemaLocation":"https://www.web3d.org/specifications/x3d-3.2.xsd",
    "JSON schema":"https://www.web3d.org/specifications/x3d-4.0-JSONSchema.autogenerated.json",
    "head": {
        "meta": [
          {
            "@name":"title",
            "@content":"DoubleClickTouchSensorExample.x3d"
          },
          {
            "@name":"description",
            "@content":"Double-click TouchSensor design pattern, showing example use."
          },
          {
            "@name":"creator",
            "@content":"Don Brutzman"
          },
          {
            "@name":"created",
            "@content":"26 May 2003"
          },
          {
            "@name":"modified",
            "@content":"17 June 2020"
          },
          {
            "@name":"reference",
            "@content":"DoubleClickTouchSensorPrototype.x3d"
          },
          {
            "@name":"reference",
            "@content":"https://www.web3d.org/x3d/specifications/ISO-IEC-19775-FDIS-X3dAbstractSpecification/Part01/components/pointingsensor.html#TouchSensor"
          },
          {
            "@name":"subject",
            "@content":"DoubleClickTouchSensor"
          },
          {
            "@name":"identifier",
            "@content":"https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/DoubleClickTouchSensorExample.x3d"
          },
          {
            "@name":"generator",
            "@content":"X3D-Edit 3.2, https://www.web3d.org/x3d/tools/X3D-Edit"
          },
          {
            "@name":"license",
            "@content":"../../license.html"
          },
          {
            "@name":"translated",
            "@content":"26 March 2026"
          },
          {
            "@name":"generator",
            "@content":"X3dToJson.xslt, https://www.web3d.org/x3d/stylesheets/X3dToJson.html"
          },
          {
            "@name":"reference",
            "@content":"X3D JSON encoding: https://www.web3d.org/wiki/index.php/X3D_JSON_Encoding"
          }
        ]
    },
    "Scene": {
        "-children":[
          { "WorldInfo":
            {
              "@title":"DoubleClickTouchSensorExample.x3d"
            }
          },
          { "ExternProtoDeclare":
            {
              "@name":"TimeDelaySensor",
              "@appinfo":"TimeSensor functionality commences after delayInterval pause",
              "@url":["TimeDelaySensorPrototype.x3d#TimeDelaySensor","../../../Savage/Tools/Animation/TimeDelaySensorPrototype.x3d#TimeDelaySensor","https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/TimeDelaySensorPrototype.x3d#TimeDelaySensor","TimeDelaySensorPrototype.wrl#TimeDelaySensor","../../../Savage/Tools/Animation/TimeDelaySensorPrototype.wrl#TimeDelaySensor","https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/TimeDelaySensorPrototype.wrl#TimeDelaySensor"],
              "field": [
                {
                  "@name":"description",
                  "@accessType":"inputOutput",
                  "@appinfo":"describe the purpose of this sensor",
                  "@type":"SFString"
                },
                {
                  "@name":"startTime",
                  "@accessType":"inputOutput",
                  "@type":"SFTime"
                },
                {
                  "@name":"enabled",
                  "@accessType":"inputOutput",
                  "@type":"SFBool"
                },
                {
                  "@name":"delayInterval",
                  "@accessType":"inputOutput",
                  "@appinfo":"seconds",
                  "@type":"SFTime"
                },
                {
                  "@name":"delayCompleteTime",
                  "@accessType":"outputOnly",
                  "@type":"SFTime"
                },
                {
                  "@name":"traceEnabled",
                  "@accessType":"initializeOnly",
                  "@type":"SFBool"
                }
              ]
            }
          },
          { "ExternProtoDeclare":
            {
              "@name":"DoubleClickTouchSensor",
              "@appinfo":"DoubleClickTouchSensor functionality activates when user double clicks (or double selects) within maxDelayInterval",
              "@url":["DoubleClickTouchSensorPrototype.x3d#DoubleClickTouchSensor","../../../Savage/Tools/Animation/DoubleClickTouchSensorPrototype.x3d#DoubleClickTouchSensor","https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/DoubleClickTouchSensorPrototype.x3d#DoubleClickTouchSensor","DoubleClickTouchSensorPrototype.wrl#DoubleClickTouchSensor","../../../Savage/Tools/Animation/DoubleClickTouchSensorPrototype.wrl#DoubleClickTouchSensor","https://www.web3d.org/x3d/content/examples/Savage/Tools/Animation/DoubleClickTouchSensorPrototype.wrl#DoubleClickTouchSensor"],
              "field": [
                {
                  "@name":"description",
                  "@accessType":"inputOutput",
                  "@appinfo":"describe the purpose of this sensor",
                  "@type":"SFString"
                },
                {
                  "@name":"maxDelayInterval",
                  "@accessType":"initializeOnly",
                  "@appinfo":"seconds",
                  "@type":"SFTime"
                },
                {
                  "@name":"enabled",
                  "@accessType":"inputOutput",
                  "@type":"SFBool"
                },
                {
                  "@name":"isActive",
                  "@accessType":"outputOnly",
                  "@type":"SFBool"
                },
                {
                  "@name":"isOver",
                  "@accessType":"outputOnly",
                  "@type":"SFBool"
                },
                {
                  "@name":"touchTime",
                  "@accessType":"outputOnly",
                  "@appinfo":"seconds",
                  "@type":"SFTime"
                },
                {
                  "@name":"hitPoint_changed",
                  "@accessType":"outputOnly",
                  "@type":"SFVec3f"
                },
                {
                  "@name":"hitNormal_changed",
                  "@accessType":"outputOnly",
                  "@type":"SFVec3f"
                },
                {
                  "@name":"hitTexCoord_changed",
                  "@accessType":"outputOnly",
                  "@type":"SFVec2f"
                },
                {
                  "@name":"metadata",
                  "@accessType":"initializeOnly",
                  "@appinfo":"can contain one of Metadata nodes",
                  "@type":"SFNode",
                  "-children":[
                    {
                      "#comment":"initialization node (if any) goes here"
                    }
                  ]
                },
                {
                  "@name":"traceEnabled",
                  "@accessType":"initializeOnly",
                  "@type":"SFBool"
                }
              ]
            }
          },
          {
            "#comment":"===================="
          },
          { "Group":
            {
              "@DEF":"TextTouchGroup",
              "-children":[
                { "Shape":
                  {
                    "-geometry":
                      { "Text":
                        {
                          "@string":["Double-click text then","wait for 1-second time delay","before color changes"],
                          "-fontStyle":
                            { "FontStyle":
                              {
                                "@justify":["MIDDLE","MIDDLE"]
                              }
                            }
                        }
                      },
                    "-appearance":
                      { "Appearance":
                        {
                          "-material":
                            { "Material":
                              {
                                "@DEF":"TextColor"
                              }
                            }
                        }
                      }
                  }
                },
                { "ProtoInstance":
                  {
                    "@name":"DoubleClickTouchSensor",
                    "@DEF":"TouchSensorActive",
                    "fieldValue": [
                      {
                        "@name":"description",
                        "@value":"double click to initiate time delay and color change"
                      },
                      {
                        "@name":"traceEnabled",
                        "@value":true
                      },
                      {
                        "@name":"metadata",
                        "-children":[
                          { "MetadataString":
                            {
                              "@name":"exampleTerm",
                              "@value":["exampleValue"]
                            }
                          }
                        ]
                      }
                    ]
                  }
                },
                {
                  "#comment":"===================="
                },
                { "Group":
                  {
                    "@DEF":"TextAnimationGroup",
                    "-children":[
                      { "ProtoInstance":
                        {
                          "@name":"TimeDelaySensor",
                          "@DEF":"DelayTimer",
                          "fieldValue": [
                            {
                              "@name":"delayInterval",
                              "@value":1
                            },
                            {
                              "@name":"traceEnabled",
                              "@value":true
                            }
                          ]
                        }
                      },
                      { "TimeSensor":
                        {
                          "@DEF":"AnimationClock",
                          "@cycleInterval":2
                        }
                      },
                      { "ROUTE":
                        {
                          "@fromField":"touchTime",
                          "@fromNode":"TouchSensorActive",
                          "@toField":"startTime",
                          "@toNode":"DelayTimer"
                        }
                      },
                      { "ROUTE":
                        {
                          "@fromField":"delayCompleteTime",
                          "@fromNode":"DelayTimer",
                          "@toField":"set_startTime",
                          "@toNode":"AnimationClock"
                        }
                      },
                      { "ColorInterpolator":
                        {
                          "@DEF":"ColorChangerRGB",
                          "@key":[0,0.5,1],
                          "@keyValue":[1,0,0,0,1,0,0,0,1]
                        }
                      },
                      { "ROUTE":
                        {
                          "@fromField":"value_changed",
                          "@fromNode":"ColorChangerRGB",
                          "@toField":"diffuseColor",
                          "@toNode":"TextColor"
                        }
                      },
                      { "ROUTE":
                        {
                          "@fromField":"fraction_changed",
                          "@fromNode":"AnimationClock",
                          "@toField":"set_fraction",
                          "@toNode":"ColorChangerRGB"
                        }
                      }
                    ]
                  }
                }
              ]
            }
          }
        ]
    }
  }
}