from H3DInterface import *

class BoolToFloat(TypedField(SFFloat, SFBool)):
   def __init__(self, true_val, false_val):
      TypedField(SFFloat, SFBool).__init__(self)
      self.true_val = true_val
      self.false_val = false_val
      
   def update( self, event ):
      if (event.getValue()):
			return self.true_val
      else:
			return self.false_val
boolToFloat = BoolToFloat(0, 0.5)

