aboutsummaryrefslogtreecommitdiff
path: root/behaviors/SmootWind.py
diff options
context:
space:
mode:
authorGravatar dan <dmtaub@gmail.com>2011-01-28 16:31:58 -0500
committerGravatar dan <dmtaub@gmail.com>2011-01-28 16:31:58 -0500
commitb11a72afece56dc138aac5400057668e8388f43d (patch)
treeb779455122ee1987d3fcd9b51fcffa8d03057b86 /behaviors/SmootWind.py
parent6a0bfdfb00944ae0bcc6215a194c3290b4a085f2 (diff)
parentb67a37ad06fa4c97dcdb32cecc71c7f492b12840 (diff)
Merge branch 'fridaydemo' of github.com:rcoh/SmootLight into osc
Conflicts: behaviors/ControllerOSC.py
Diffstat (limited to 'behaviors/SmootWind.py')
-rwxr-xr-xbehaviors/SmootWind.py24
1 files changed, 17 insertions, 7 deletions
diff --git a/behaviors/SmootWind.py b/behaviors/SmootWind.py
index 347e2fc..804183c 100755
--- a/behaviors/SmootWind.py
+++ b/behaviors/SmootWind.py
@@ -22,12 +22,22 @@ class SmootWind(Behavior):
for sensory in sensorInputs:
print sensory
# input[0] is windspeed, [1] is dir
- windSpeed = sensory[0]
- windDir = sensory[1]
+ if 0 in sensory and 1 in sensory:
+ windSpeed = sensory[0]
+ windDir = sensory[1]
+ #print self.mapper.argDict
+ self.mapper.argDict['Width'] = self.mapper.argDict['Width']+float(windSpeed)*2+20
+ self.xFor.argDict['ParamOp'] = self.xFor.argDict['ParamOp']+float(windSpeed)*3+10*random.random();
+ #print 'Width: ' + str(self.mapper.argDict['Width'])
+ #print 'xFor: ' + str(self.xFor.argDict['ParamOp'])
+
+ elif 'Key' in sensory:
+ if sensory['Key'] == 273:
+ self.mapper.argDict['Width'] = self.mapper.argDict['Width']+10;
+ self.xFor.argDict['ParamOp'] = self.xFor.argDict['ParamOp']+5;
+
+ elif sensory['Key'] == 274:
+ self.mapper.argDict['Width'] = self.mapper.argDict['Width']-10;
+ self.xFor.argDict['ParamOp'] = self.xFor.argDict['ParamOp']-5;
- #print self.mapper.argDict
- self.mapper.argDict['Width'] = float(windSpeed)*2+20
- self.xFor.argDict['ParamOp'] = float(windSpeed)*3+10*random.random();
- #print 'Width: ' + str(self.mapper.argDict['Width'])
- #print 'xFor: ' + str(self.xFor.argDict['ParamOp'])
return (sensorInputs, recursiveInputs)