#VRML V2.0 utf8 # #
#return : [PlaneSensor] , [NavigationInfo] #

#ex-planesensor.wrl
# example of PlaneSensor - based on a Dimension X 2.0 Example

WorldInfo {
  title "PlaneSensor Test"
  info [ "Dimension X VRML 2.0 Test Suite",
         "Test of the PlaneSensor node" ]
           }
Viewpoint {
   position 0 8 16
   orientation 1 0 0 -0.4
           }
NavigationInfo {
   type "WALK"
   speed 10
                }
PointLight {
   location 1000 1000 1000
            }
# defining the "table of the figure"
Transform {
   translation 0 -1.2 0
   children [
          Shape {
      appearance Appearance {
                 material Material { diffuseColor 0. 0.7 0.7 }
                             }
      geometry Box { size 20 0.4 20 }
                  }
             ]
           }
# Sphere (max and min are defined so  that sphere can not disappear
#         under the table) 
Transform {
   translation 4 0 4 
   children [
      DEF SPHERE_TRANSFORM Transform {
         children Shape {
            appearance Appearance {
               material Material { diffuseColor 0.5 0 0.8 }
                         }
            geometry Sphere { }
                                   }
                                      }
      DEF PLANE_SENSOR0 PlaneSensor {
         minPosition -2 -1
         maxPosition 2 2
                                     }
            ]
          }
# Cone
Transform {
   translation 0 0 4
   children [
      DEF CONE_TRANSFORM Transform {
         children Shape {
            appearance Appearance {
               material Material { diffuseColor 0 0 1 }
            }
            geometry Cone {}
         }
      }
      DEF PLANE_SENSOR1 PlaneSensor {
         minPosition -5 -5
         maxPosition 5 5
      }
            ]     
           }
# Cylinder
Transform {
   translation 6 0 0
   children [
      DEF CYLINDER_TRANSFORM Transform {
         children Shape {
            appearance Appearance {
               material Material { diffuseColor 0.1 0.5 0.2 }
            }
            geometry Cylinder {}
         }
      }
      DEF PLANE_SENSOR2 PlaneSensor {
         minPosition -10 -10
         maxPosition 10 10
      }
     ]
}
                       
ROUTE PLANE_SENSOR0.translation_changed TO SPHERE_TRANSFORM.set_translation
ROUTE PLANE_SENSOR1.translation_changed TO CONE_TRANSFORM.set_translation
ROUTE PLANE_SENSOR2.translation_changed TO CYLINDER_TRANSFORM.set_translation


#