@prefix :        <https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/ProjectileSliderBarPrototype.ttl#> .
@prefix owl:     <http://www.w3.org/2002/07/owl#> .
@prefix rdf:     <http://www.w3.org/1999/02/22-rdf-syntax-ns#> .
@prefix rdfs:    <http://www.w3.org/2000/01/rdf-schema#> .
@prefix schema:  <http://schema.org/> .
@prefix dcterms: <http://purl.org/dc/terms/> .
@prefix xsd:     <http://www.w3.org/2001/XMLSchema#> .
@prefix x3d:     <https://www.web3d.org/specifications/x3d-4.0.xsd#> .
@prefix x3do:    <https://www.web3d.org/specifications/X3dOntology4.0#> .

:X3D a owl:NamedIndividual, x3do:X3D ;
  x3do:hasHead :head ;
  x3do:hasScene :Scene ;
  x3do:profile 'Immersive' ;
  x3do:version '3.0' ;
  x3do:noNamespaceSchemaLocation 'https://www.web3d.org/specifications/x3d-3.0.xsd' .
:head a owl:NamedIndividual, x3do:head ;
  x3do:hasParent :X3D ;
  x3do:hasMeta :meta_1_1, :meta_1_2, :meta_1_3, :meta_1_4, :meta_1_5, :meta_1_6, :meta_1_7, :meta_1_8 .
:meta_1_1 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'ProjectileSliderBarPrototype.x3d' ;
  x3do:name 'title' .
:meta_1_2 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'A generic slider bar prototype. Colors, size of the bar and name are changable.' ;
  x3do:name 'description' .
:meta_1_3 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'Ozan APAYDIN' ;
  x3do:name 'creator' .
:meta_1_4 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '1 December 2001' ;
  x3do:name 'created' .
:meta_1_5 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '30 November 2024' ;
  x3do:name 'modified' .
:meta_1_6 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/ProjectileSliderBarPrototype.x3d' ;
  x3do:name 'identifier' .
:meta_1_7 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content 'X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit' ;
  x3do:name 'generator' .
:meta_1_8 a owl:NamedIndividual, x3do:meta ;
  x3do:hasParent :head ;
  x3do:content '../license.html' ;
  x3do:name 'license' .
:meta dcterms:title "ProjectileSliderBarPrototype.x3d" .
:meta dcterms:description "A generic slider bar prototype. Colors, size of the bar and name are changable." .
:meta dcterms:creator "Ozan APAYDIN" .
:meta dcterms:created "1 December 2001" .
:meta dcterms:modified "30 November 2024" .
:meta dcterms:identifier "https://www.web3d.org/x3d/content/examples/Basic/StudentProjects/ProjectileSliderBarPrototype.x3d" .
:meta dcterms:generator "X3D-Edit 3.3, https://www.web3d.org/x3d/tools/X3D-Edit" .
:meta dcterms:license "../license.html" .
:Scene a owl:NamedIndividual, x3do:Scene ;
  x3do:hasParent :X3D ;
  x3do:hasChildren :WorldInfo_2_1, :Viewpoint_2_3, :ProtoInstance_2_4 ;
  x3do:hasProtoDeclare :ProtoDeclare_2_2 .
:WorldInfo_2_1 a owl:NamedIndividual, x3do:WorldInfo ;
  x3do:hasParent :Scene ;
  x3do:title 'ProjectileSliderBarPrototype.x3d' .
:ProtoDeclare_2_2 a owl:NamedIndividual, x3do:ProtoDeclare ;
  x3do:hasParent :Scene ;
  x3do:hasProtoInterface :ProtoInterface_2_2_1 ;
  x3do:hasProtoBody :ProtoBody_2_2_2 ;
  x3do:name 'ProjectileSliderBar' .
:ProtoInterface_2_2_1 a owl:NamedIndividual, x3do:ProtoInterface ;
  x3do:hasParent :ProtoDeclare_2_2 ;
  x3do:hasField :field_2_2_1_1, :field_2_2_1_2, :field_2_2_1_3, :field_2_2_1_4, :field_2_2_1_5, :field_2_2_1_6, :field_2_2_1_7, :field_2_2_1_8, :field_2_2_1_9, :field_2_2_1_10, :field_2_2_1_11, :field_2_2_1_12, :field_2_2_1_13 .
:field_2_2_1_1 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'Name of the Slider Bar. It appears on the left side of the bar.' ;
  x3do:name 'name' ;
  x3do:type 'MFString' .
:field_2_2_1_2 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'Length of the Slider bar. According to given value bar will arrange itself.' ;
  x3do:name 'length' ;
  x3do:type 'SFFloat' ;
  x3do:value 1 .
:field_2_2_1_3 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'Width of the Slider bar. According to given value bar will arrange itself.' ;
  x3do:name 'width' ;
  x3do:type 'SFFloat' ;
  x3do:value 1 .
:field_2_2_1_4 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'Max. value of Slider Bar.It can be assigned a positive or a negative value.' ;
  x3do:name 'maxValue' ;
  x3do:type 'SFFloat' ;
  x3do:value 1 .
:field_2_2_1_5 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'Min. value of Slider Bar. It can be assigned a positive or a negative value.' ;
  x3do:name 'minValue' ;
  x3do:type 'SFFloat' ;
  x3do:value 0 .
:field_2_2_1_6 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'Color of Slider Bar.' ;
  x3do:name 'barColor' ;
  x3do:type 'SFColor' ;
  x3do:value ( 1 0 0 ) .
:field_2_2_1_7 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'Pointer Color of Slider Bar.' ;
  x3do:name 'pointerColor' ;
  x3do:type 'SFColor' ;
  x3do:value ( 1 1 0 ) .
:field_2_2_1_8 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'Slider Bar Name Color.' ;
  x3do:name 'nameColor' ;
  x3do:type 'SFColor' ;
  x3do:value ( 1 0 1 ) .
:field_2_2_1_9 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'Color of Current Value text.' ;
  x3do:name 'currentValueColor' ;
  x3do:type 'SFColor' ;
  x3do:value ( 0.2 0.8 0.2 ) .
:field_2_2_1_10 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'outputOnly' ;
  x3do:appinfo 'If the precision is 0 current Value will be output in this eventOut field as Integer else in currentValueFloat eventOut field as Float.' ;
  x3do:name 'currentValueInt' ;
  x3do:type 'SFInt32' .
:field_2_2_1_11 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'outputOnly' ;
  x3do:appinfo 'If the precision is NOT 0 current Value will be output in this eventOut field as Float else in currentValueInt eventOut field as Integer.' ;
  x3do:name 'currentValueFloat' ;
  x3do:type 'SFFloat' .
:field_2_2_1_12 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'Count of the numbers after Decimal Point. Example : If precision is 2 1.562777 -> 1.56' ;
  x3do:name 'precision' ;
  x3do:type 'SFInt32' ;
  x3do:value 2 .
:field_2_2_1_13 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ProtoInterface_2_2_1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:appinfo 'Translation values of Slider Bar to define its location on the screen.' ;
  x3do:name 'translation' ;
  x3do:type 'SFVec3f' ;
  x3do:value ( 0 0 0 ) .
:ProtoBody_2_2_2 a owl:NamedIndividual, x3do:ProtoBody ;
  x3do:hasParent :ProtoDeclare_2_2 ;
  x3do:hasChildren :HUDGroup, :ShapeOrganizer, :CurrentValueFinder ;
  x3do:hasROUTE :ROUTE_2_2_2_4, :ROUTE_2_2_2_5, :ROUTE_2_2_2_6, :ROUTE_2_2_2_7, :ROUTE_2_2_2_8 .
:HUDGroup a owl:NamedIndividual, x3do:Group ;
  x3do:hasParent :ProtoBody_2_2_2 ;
  x3do:hasChildren :Collision_2_2_2_1_1 ;
  x3do:DEF 'HUDGroup' .
:Collision_2_2_2_1_1 a owl:NamedIndividual, x3do:Collision ;
  x3do:hasParent :HUDGroup ;
  x3do:hasChildren :HudProx, :HudTransform ;
  x3do:enabled false .
:HudProx a owl:NamedIndividual, x3do:ProximitySensor ;
  x3do:hasParent :Collision_2_2_2_1_1 ;
  x3do:DEF 'HudProx' ;
  x3do:size ( 1000000 1000000 1000000 ) .
:HudTransform a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :Collision_2_2_2_1_1 ;
  x3do:hasChildren :Transform_2_2_2_1_1_2_1 ;
  x3do:DEF 'HudTransform' .
:Transform_2_2_2_1_1_2_1 a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :HudTransform ;
  x3do:hasChildren :SliderTransform ;
  x3do:translation ( 0 0 -0.2 ) .
:SliderTransform a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :Transform_2_2_2_1_1_2_1 ;
  x3do:hasIS :IS_2_2_2_1_1_2_1_1_1 ;
  x3do:hasChildren :SliderShape ;
  x3do:DEF 'SliderTransform' .
:IS_2_2_2_1_1_2_1_1_1 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :SliderTransform ;
  x3do:hasConnect :connect_2_2_2_1_1_2_1_1_1_1 .
:connect_2_2_2_1_1_2_1_1_1_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_1_1_2_1_1_1 ;
  x3do:nodeField 'translation' ;
  x3do:protoField 'translation' .
:SliderShape a owl:NamedIndividual, x3do:Group ;
  x3do:hasParent :SliderTransform ;
  x3do:hasChildren :barTransform, :pointerTransform, :sliderNameTransform, :currentValueTransform ;
  x3do:DEF 'SliderShape' .
:barTransform a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :SliderShape ;
  x3do:hasChildren :Shape_2_2_2_1_1_2_1_1_2_1_1 ;
  x3do:DEF 'barTransform' .
:Shape_2_2_2_1_1_2_1_1_2_1_1 a owl:NamedIndividual, x3do:Shape ;
  x3do:hasParent :barTransform ;
  x3do:hasAppearance :Appearance_2_2_2_1_1_2_1_1_2_1_1_1 ;
  x3do:hasGeometry :bar .
:Appearance_2_2_2_1_1_2_1_1_2_1_1_1 a owl:NamedIndividual, x3do:Appearance ;
  x3do:hasParent :Shape_2_2_2_1_1_2_1_1_2_1_1 ;
  x3do:hasMaterial :BarColor .
:BarColor a owl:NamedIndividual, x3do:Material ;
  x3do:hasParent :Appearance_2_2_2_1_1_2_1_1_2_1_1_1 ;
  x3do:hasIS :IS_2_2_2_1_1_2_1_1_2_1_1_1_1_1 ;
  x3do:DEF 'BarColor' ;
  x3do:diffuseColor ( 0 0 1 ) .
:IS_2_2_2_1_1_2_1_1_2_1_1_1_1_1 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :BarColor ;
  x3do:hasConnect :connect_2_2_2_1_1_2_1_1_2_1_1_1_1_1_1 .
:connect_2_2_2_1_1_2_1_1_2_1_1_1_1_1_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_1_1_2_1_1_2_1_1_1_1_1 ;
  x3do:nodeField 'diffuseColor' ;
  x3do:protoField 'barColor' .
:bar a owl:NamedIndividual, x3do:Box ;
  x3do:hasParent :Shape_2_2_2_1_1_2_1_1_2_1_1 ;
  x3do:DEF 'bar' ;
  x3do:size ( 0.05 0.001 0.000001 ) .
:pointerTransform a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :SliderShape ;
  x3do:hasChildren :Shape_2_2_2_1_1_2_1_1_2_2_1, :SVPlaneSensor ;
  x3do:DEF 'pointerTransform' .
:Shape_2_2_2_1_1_2_1_1_2_2_1 a owl:NamedIndividual, x3do:Shape ;
  x3do:hasParent :pointerTransform ;
  x3do:hasAppearance :Appearance_2_2_2_1_1_2_1_1_2_2_1_1 ;
  x3do:hasGeometry :pointer .
:Appearance_2_2_2_1_1_2_1_1_2_2_1_1 a owl:NamedIndividual, x3do:Appearance ;
  x3do:hasParent :Shape_2_2_2_1_1_2_1_1_2_2_1 ;
  x3do:hasMaterial :PointerColor .
:PointerColor a owl:NamedIndividual, x3do:Material ;
  x3do:hasParent :Appearance_2_2_2_1_1_2_1_1_2_2_1_1 ;
  x3do:hasIS :IS_2_2_2_1_1_2_1_1_2_2_1_1_1_1 ;
  x3do:DEF 'PointerColor' ;
  x3do:diffuseColor ( 1 1 0 ) .
:IS_2_2_2_1_1_2_1_1_2_2_1_1_1_1 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :PointerColor ;
  x3do:hasConnect :connect_2_2_2_1_1_2_1_1_2_2_1_1_1_1_1 .
:connect_2_2_2_1_1_2_1_1_2_2_1_1_1_1_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_1_1_2_1_1_2_2_1_1_1_1 ;
  x3do:nodeField 'diffuseColor' ;
  x3do:protoField 'pointerColor' .
:pointer a owl:NamedIndividual, x3do:Cone ;
  x3do:hasParent :Shape_2_2_2_1_1_2_1_1_2_2_1 ;
  x3do:DEF 'pointer' ;
  x3do:bottomRadius 0.0025 ;
  x3do:height 0.005 .
:SVPlaneSensor a owl:NamedIndividual, x3do:PlaneSensor ;
  x3do:hasParent :pointerTransform ;
  x3do:DEF 'SVPlaneSensor' ;
  x3do:maxPosition ( 0.025 0 ) ;
  x3do:minPosition ( -0.025 0 ) .
:sliderNameTransform a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :SliderShape ;
  x3do:hasChildren :Shape_2_2_2_1_1_2_1_1_2_3_1 ;
  x3do:DEF 'sliderNameTransform' .
:Shape_2_2_2_1_1_2_1_1_2_3_1 a owl:NamedIndividual, x3do:Shape ;
  x3do:hasParent :sliderNameTransform ;
  x3do:hasGeometry :SliderName ;
  x3do:hasAppearance :Appearance_2_2_2_1_1_2_1_1_2_3_1_2 .
:SliderName a owl:NamedIndividual, x3do:Text ;
  x3do:hasParent :Shape_2_2_2_1_1_2_1_1_2_3_1 ;
  x3do:hasIS :IS_2_2_2_1_1_2_1_1_2_3_1_1_1 ;
  x3do:hasFontStyle :FontStyle_2_2_2_1_1_2_1_1_2_3_1_1_2 ;
  x3do:DEF 'SliderName' .
:IS_2_2_2_1_1_2_1_1_2_3_1_1_1 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :SliderName ;
  x3do:hasConnect :connect_2_2_2_1_1_2_1_1_2_3_1_1_1_1 .
:connect_2_2_2_1_1_2_1_1_2_3_1_1_1_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_1_1_2_1_1_2_3_1_1_1 ;
  x3do:nodeField 'string' ;
  x3do:protoField 'name' .
:FontStyle_2_2_2_1_1_2_1_1_2_3_1_1_2 a owl:NamedIndividual, x3do:FontStyle ;
  x3do:hasParent :SliderName ;
  x3do:justify '"END"' ;
  x3do:size 0.0085 ;
  x3do:cssStyle 'BOLD' .
:Appearance_2_2_2_1_1_2_1_1_2_3_1_2 a owl:NamedIndividual, x3do:Appearance ;
  x3do:hasParent :Shape_2_2_2_1_1_2_1_1_2_3_1 ;
  x3do:hasMaterial :sliderNameColor .
:sliderNameColor a owl:NamedIndividual, x3do:Material ;
  x3do:hasParent :Appearance_2_2_2_1_1_2_1_1_2_3_1_2 ;
  x3do:hasIS :IS_2_2_2_1_1_2_1_1_2_3_1_2_1_1 ;
  x3do:DEF 'sliderNameColor' .
:IS_2_2_2_1_1_2_1_1_2_3_1_2_1_1 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :sliderNameColor ;
  x3do:hasConnect :connect_2_2_2_1_1_2_1_1_2_3_1_2_1_1_1 .
:connect_2_2_2_1_1_2_1_1_2_3_1_2_1_1_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_1_1_2_1_1_2_3_1_2_1_1 ;
  x3do:nodeField 'diffuseColor' ;
  x3do:protoField 'nameColor' .
:currentValueTransform a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :SliderShape ;
  x3do:hasChildren :currentValue ;
  x3do:DEF 'currentValueTransform' .
:currentValue a owl:NamedIndividual, x3do:Shape ;
  x3do:hasParent :currentValueTransform ;
  x3do:hasGeometry :currentValueText ;
  x3do:hasAppearance :Appearance_2_2_2_1_1_2_1_1_2_4_1_2 ;
  x3do:DEF 'currentValue' .
:currentValueText a owl:NamedIndividual, x3do:Text ;
  x3do:hasParent :currentValue ;
  x3do:hasFontStyle :currentValueFont ;
  x3do:DEF 'currentValueText' .
:currentValueFont a owl:NamedIndividual, x3do:FontStyle ;
  x3do:hasParent :currentValueText ;
  x3do:DEF 'currentValueFont' ;
  x3do:justify '"BEGIN" "MIDDLE"' ;
  x3do:size 0.0085 ;
  x3do:cssStyle 'BOLD' .
:Appearance_2_2_2_1_1_2_1_1_2_4_1_2 a owl:NamedIndividual, x3do:Appearance ;
  x3do:hasParent :currentValue ;
  x3do:hasMaterial :valueColor .
:valueColor a owl:NamedIndividual, x3do:Material ;
  x3do:hasParent :Appearance_2_2_2_1_1_2_1_1_2_4_1_2 ;
  x3do:hasIS :IS_2_2_2_1_1_2_1_1_2_4_1_2_1_1 ;
  x3do:DEF 'valueColor' .
:IS_2_2_2_1_1_2_1_1_2_4_1_2_1_1 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :valueColor ;
  x3do:hasConnect :connect_2_2_2_1_1_2_1_1_2_4_1_2_1_1_1 .
:connect_2_2_2_1_1_2_1_1_2_4_1_2_1_1_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_1_1_2_1_1_2_4_1_2_1_1 ;
  x3do:nodeField 'diffuseColor' ;
  x3do:protoField 'currentValueColor' .
:ShapeOrganizer a owl:NamedIndividual, x3do:Script ;
  x3do:hasParent :ProtoBody_2_2_2 ;
  x3do:hasField :field_2_2_2_2_1, :field_2_2_2_2_2, :field_2_2_2_2_3, :field_2_2_2_2_4, :field_2_2_2_2_5, :field_2_2_2_2_6, :field_2_2_2_2_7, :field_2_2_2_2_8 ;
  x3do:hasIS :IS_2_2_2_2_9 ;
  x3do:DEF 'ShapeOrganizer' ;
  x3do:directOutput true ;
  x3do:sourceCode """
ecmascript:
function initialize() {
      
   for(i = 0; i < 3; i++) { 
      BarTransformNode.scale[i] = 1;
      if(i == 2) {
         PointerTransformNode.scale[i] = 0.1; 
      }
      else {
         PointerTransformNode.scale[i] = 1;
      }
   } 
   setBarSize();
   setPointerSize();
   setCurrentValueTransform();
   setNameTransform();
}

function setBarSize() {
   BarTransformNode.scale[0] = Length * BarTransformNode.scale[0];
   BarTransformNode.scale[1] = Width * BarTransformNode.scale[1];
}

function setPointerSize() {
   PointerTransformNode.scale[0] = Width * PointerTransformNode.scale[0];
   PointerTransformNode.scale[1] = Width * PointerTransformNode.scale[1];
   SVPlaneSensorNode.minPosition[0] = Length * SVPlaneSensorNode.minPosition[0];
   SVPlaneSensorNode.maxPosition[0] = Length * SVPlaneSensorNode.maxPosition[0];
}

function setCurrentValueTransform() {
   CurrentValueTransformNode.translation[0] = (BarTransformNode.scale[0] * 0.05 / 2) + (BarTransformNode.scale[1] * 0.001 * 2);
}

function setNameTransform() {
   SliderNameTransformNode.translation[0] = -((BarTransformNode.scale[0] * 0.05 / 2) + (BarTransformNode.scale[1] * 0.001 * 2));
}
""" .
:field_2_2_2_2_1 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ShapeOrganizer ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'Length' ;
  x3do:type 'SFFloat' .
:field_2_2_2_2_2 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ShapeOrganizer ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'Width' ;
  x3do:type 'SFFloat' .
:field_2_2_2_2_3 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ShapeOrganizer ;
  x3do:hasChildren :sliderNameTransform-USE-1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'SliderNameTransformNode' ;
  x3do:type 'SFNode' .
:sliderNameTransform-USE-1 a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :field_2_2_2_2_3 ;
  owl:sameAs :sliderNameTransform . # DEF matching this USE
:field_2_2_2_2_4 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ShapeOrganizer ;
  x3do:hasChildren :currentValueTransform-USE-1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'CurrentValueTransformNode' ;
  x3do:type 'SFNode' .
:currentValueTransform-USE-1 a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :field_2_2_2_2_4 ;
  owl:sameAs :currentValueTransform . # DEF matching this USE
:field_2_2_2_2_5 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ShapeOrganizer ;
  x3do:hasChildren :barTransform-USE-1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'BarTransformNode' ;
  x3do:type 'SFNode' .
:barTransform-USE-1 a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :field_2_2_2_2_5 ;
  owl:sameAs :barTransform . # DEF matching this USE
:field_2_2_2_2_6 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ShapeOrganizer ;
  x3do:hasChildren :pointerTransform-USE-1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'PointerTransformNode' ;
  x3do:type 'SFNode' .
:pointerTransform-USE-1 a owl:NamedIndividual, x3do:Transform ;
  x3do:hasParent :field_2_2_2_2_6 ;
  owl:sameAs :pointerTransform . # DEF matching this USE
:field_2_2_2_2_7 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ShapeOrganizer ;
  x3do:hasGeometry :currentValueText-USE-1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'CurrentValueText' ;
  x3do:type 'SFNode' .
:currentValueText-USE-1 a owl:NamedIndividual, x3do:Text ;
  x3do:hasParent :field_2_2_2_2_7 ;
  owl:sameAs :currentValueText . # DEF matching this USE
:field_2_2_2_2_8 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :ShapeOrganizer ;
  x3do:hasChildren :SVPlaneSensor-USE-1 ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'SVPlaneSensorNode' ;
  x3do:type 'SFNode' .
:SVPlaneSensor-USE-1 a owl:NamedIndividual, x3do:PlaneSensor ;
  x3do:hasParent :field_2_2_2_2_8 ;
  owl:sameAs :SVPlaneSensor . # DEF matching this USE
:IS_2_2_2_2_9 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :ShapeOrganizer ;
  x3do:hasConnect :connect_2_2_2_2_9_1, :connect_2_2_2_2_9_2 .
:connect_2_2_2_2_9_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_2_9 ;
  x3do:nodeField 'Length' ;
  x3do:protoField 'length' .
:connect_2_2_2_2_9_2 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_2_9 ;
  x3do:nodeField 'Width' ;
  x3do:protoField 'width' .
:CurrentValueFinder a owl:NamedIndividual, x3do:Script ;
  x3do:hasParent :ProtoBody_2_2_2 ;
  x3do:hasField :field_2_2_2_3_1, :field_2_2_2_3_2, :field_2_2_2_3_3, :field_2_2_2_3_4, :field_2_2_2_3_5, :field_2_2_2_3_6, :field_2_2_2_3_7, :field_2_2_2_3_8 ;
  x3do:hasIS :IS_2_2_2_3_9 ;
  x3do:DEF 'CurrentValueFinder' ;
  x3do:directOutput true ;
  x3do:sourceCode """
ecmascript:

var totalLength;

function initialize() {
   realValue = (MaxValue + MinValue) / 2;
   realValue = roundOff(realValue, Precision);
   CurrentValueFloat = realValue;
   CurrentValueInt = Math.round(realValue);
   totalLength = SVPlaneSensorNode.maxPosition[0] - SVPlaneSensorNode.minPosition[0];
   updateCurrentValueText(realValue.toString()); 
}

//Map pointer translation value to the real value
function updateCurrentValue(translation, timeEvent) {
   var displayString;
   var curPositionOnBar = translation[0] + totalLength / 2;
   var x = (MaxValue - MinValue) * curPositionOnBar / totalLength;
   
   var realValue = MinValue + x;

   if(Precision == 0) { //If 
      CurrentValueInt = Math.round(realValue);
      displayString = CurrentValueInt.toString();
   }
   else {
      CurrentValueFloat = roundOff(realValue, Precision);       
      displayString = CurrentValueFloat.toString();
   } 
      
   updateCurrentValueText(displayString);
}


function updateCurrentValueText(dispStr) {
   CurrentValueTextNode.string[0] = dispStr;
}

//A function to round the values regarding to given precision.
function roundOff(value, precision) {

   var result;
   var isNegative = false;
   var wholeInt = Math.round(value * Math.pow(10, precision));
 
   //Negative numbers creates exceptional condition, therefor they are converted
   //to positive values.
   if(wholeInt < 0) {
      wholeInt = -wholeInt;
      isNegative = true;
   }

   var whole = wholeInt.toString();
   
   var decPoint = whole.length - precision;
   
   //Exception when precision is bigger than the string length   
   if(decPoint < 0) {
      i = -decPoint;
      for(i; i > 0; i--) {  
         whole ='0' + whole;
      }

      //Calculate decPoint according to new string expanded with 0s      
      decPoint = whole.length - precision;
   }

   if(whole !='0') {
      //Put the decimal point on the appropriate place
      result = whole.substring(0, decPoint);
      result +='.';
      result += whole.substring(decPoint, whole.length);
   }
   else { //If the string is'0', then result is'0'
      result = whole;
   }
   
   //Negative numbers are altered.
   if(isNegative) {
      result ='-' + result;
   }
   //Convert the String value to Float.
   resultFloat = parseFloat(result); 
  
  
   return resultFloat;
  
}
""" .
:field_2_2_2_3_1 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :CurrentValueFinder ;
  x3do:hasChildren :SVPlaneSensor-USE-2 ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'SVPlaneSensorNode' ;
  x3do:type 'SFNode' .
:SVPlaneSensor-USE-2 a owl:NamedIndividual, x3do:PlaneSensor ;
  x3do:hasParent :field_2_2_2_3_1 ;
  owl:sameAs :SVPlaneSensor . # DEF matching this USE
:field_2_2_2_3_2 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :CurrentValueFinder ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'MaxValue' ;
  x3do:type 'SFFloat' .
:field_2_2_2_3_3 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :CurrentValueFinder ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'MinValue' ;
  x3do:type 'SFFloat' .
:field_2_2_2_3_4 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :CurrentValueFinder ;
  x3do:hasGeometry :currentValueText-USE-2 ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'CurrentValueTextNode' ;
  x3do:type 'SFNode' .
:currentValueText-USE-2 a owl:NamedIndividual, x3do:Text ;
  x3do:hasParent :field_2_2_2_3_4 ;
  owl:sameAs :currentValueText . # DEF matching this USE
:field_2_2_2_3_5 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :CurrentValueFinder ;
  x3do:accessType 'inputOnly' ;
  x3do:name 'updateCurrentValue' ;
  x3do:type 'SFVec3f' .
:field_2_2_2_3_6 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :CurrentValueFinder ;
  x3do:accessType 'outputOnly' ;
  x3do:name 'CurrentValueInt' ;
  x3do:type 'SFInt32' .
:field_2_2_2_3_7 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :CurrentValueFinder ;
  x3do:accessType 'outputOnly' ;
  x3do:name 'CurrentValueFloat' ;
  x3do:type 'SFFloat' .
:field_2_2_2_3_8 a owl:NamedIndividual, x3do:field ;
  x3do:hasParent :CurrentValueFinder ;
  x3do:accessType 'initializeOnly' ;
  x3do:name 'Precision' ;
  x3do:type 'SFInt32' .
:IS_2_2_2_3_9 a owl:NamedIndividual, x3do:IS ;
  x3do:hasParent :CurrentValueFinder ;
  x3do:hasConnect :connect_2_2_2_3_9_1, :connect_2_2_2_3_9_2, :connect_2_2_2_3_9_3, :connect_2_2_2_3_9_4, :connect_2_2_2_3_9_5 .
:connect_2_2_2_3_9_1 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_3_9 ;
  x3do:nodeField 'MaxValue' ;
  x3do:protoField 'maxValue' .
:connect_2_2_2_3_9_2 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_3_9 ;
  x3do:nodeField 'MinValue' ;
  x3do:protoField 'minValue' .
:connect_2_2_2_3_9_3 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_3_9 ;
  x3do:nodeField 'CurrentValueInt' ;
  x3do:protoField 'currentValueInt' .
:connect_2_2_2_3_9_4 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_3_9 ;
  x3do:nodeField 'CurrentValueFloat' ;
  x3do:protoField 'currentValueFloat' .
:connect_2_2_2_3_9_5 a owl:NamedIndividual, x3do:connect ;
  x3do:hasParent :IS_2_2_2_3_9 ;
  x3do:nodeField 'Precision' ;
  x3do:protoField 'precision' .
:ROUTE_2_2_2_4 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :ProtoBody_2_2_2 ;
  x3do:fromField 'position_changed' ;
  x3do:fromNode 'HudProx' ;
  x3do:toField 'set_translation' ;
  x3do:toNode 'HudTransform' .
:ROUTE_2_2_2_5 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :ProtoBody_2_2_2 ;
  x3do:fromField 'orientation_changed' ;
  x3do:fromNode 'HudProx' ;
  x3do:toField 'set_rotation' ;
  x3do:toNode 'HudTransform' .
:ROUTE_2_2_2_6 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :ProtoBody_2_2_2 ;
  x3do:fromField 'position_changed' ;
  x3do:fromNode 'HudProx' ;
  x3do:toField 'center' ;
  x3do:toNode 'HudProx' .
:ROUTE_2_2_2_7 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :ProtoBody_2_2_2 ;
  x3do:fromField 'translation_changed' ;
  x3do:fromNode 'SVPlaneSensor' ;
  x3do:toField 'set_translation' ;
  x3do:toNode 'pointerTransform' .
:ROUTE_2_2_2_8 a owl:NamedIndividual, x3do:ROUTE ;
  x3do:hasParent :ProtoBody_2_2_2 ;
  x3do:fromField 'translation_changed' ;
  x3do:fromNode 'SVPlaneSensor' ;
  x3do:toField 'updateCurrentValue' ;
  x3do:toNode 'CurrentValueFinder' .
:Viewpoint_2_3 a owl:NamedIndividual, x3do:Viewpoint ;
  x3do:hasParent :Scene ;
  x3do:description 'Slider bar' ;
  x3do:position ( 0 0 5 ) .
:ProtoInstance_2_4 a owl:NamedIndividual, x3do:ProtoInstance ;
  x3do:hasParent :Scene ;
  x3do:hasFieldValue :fieldValue_2_4_1, :fieldValue_2_4_2, :fieldValue_2_4_3, :fieldValue_2_4_4, :fieldValue_2_4_5 ;
  x3do:name 'ProjectileSliderBar' .
:fieldValue_2_4_1 a owl:NamedIndividual, x3do:fieldValue ;
  x3do:hasParent :ProtoInstance_2_4 ;
  x3do:name 'name' ;
  x3do:value '"AFAA"' .
:fieldValue_2_4_2 a owl:NamedIndividual, x3do:fieldValue ;
  x3do:hasParent :ProtoInstance_2_4 ;
  x3do:name 'length' ;
  x3do:value 1.5 .
:fieldValue_2_4_3 a owl:NamedIndividual, x3do:fieldValue ;
  x3do:hasParent :ProtoInstance_2_4 ;
  x3do:name 'width' ;
  x3do:value 1 .
:fieldValue_2_4_4 a owl:NamedIndividual, x3do:fieldValue ;
  x3do:hasParent :ProtoInstance_2_4 ;
  x3do:name 'maxValue' ;
  x3do:value 10 .
:fieldValue_2_4_5 a owl:NamedIndividual, x3do:fieldValue ;
  x3do:hasParent :ProtoInstance_2_4 ;
  x3do:name 'minValue' ;
  x3do:value -2 .
