def runExperimentPathSet(self, pathNum, myTimeline=None): global speedMultiplier # speedMultipler = 1 # for ps in self.pathSets: print pathNum print len(self.pathSets) ps = self.pathSets[pathNum] if myTimeline != None: timeline = myTimeline else: timeline = self.timelines[pathNum] self.peopleset = [] newPs = PathSet() for personPath in ps.peoplePaths: p = people.a_person(speedMultiplier) p.custom_walk(personPath.getFullPath()) self.peopleset.append(p) tophat = people.a_person(speedMultiplier, 1) self.abe = tophat tophat.custom_walk(ps.abePath.getFullPath()) self.peopleset.append(tophat) self.starttime = viz.tick() self.errlist = [] self.timelist = [] # error_timer = vizact.ontimer(0.1/speedMultiplier,self.checkError,tophat,self.errlist) error_timer = vizact.onupdate(-10, self.checkError, tophat) yield self.runPathSet(self.peopleset, newPs, tophat, 1, timeline) vizact.removeEvent(error_timer)
def remove(self): #self.parentRoom.physEnv.removeGeom(self.physGeom) vizact.removeEvent(self.updateNodeAct) self.geom.setBody(None) self.parentSpace.remove(self.geom) #self.parentWorld.remove() #dBodyDestroy(dBodyID); # Remove kinematic body del self.body self.body = 0
def playPhoneAndRadio(): global main_screen, radio, selector, phoneEvent yield screen.playsound('resources/audio/vibrate.wav', viz.STOP) yield selector.disable() yield selector.disable() yield screen.endAction( pool = 0) yield vizact.removeEvent(phoneEvent) voicemail = screen.playsound('resources/audio/voicemail_mono.wav', viz.PLAY) yield viztask.waitTime(voicemail.getDuration()) newsReport = radio.playsound('resources/audio/RadioShowScene_louder.wav') yield viztask.waitTime(newsReport.getDuration()) viz.sendEvent(INTRO_OVER_EVENT)
def disableHMDTracking(self): if( self.mainViewUpdateAction ): print 'phaseSpaceInterface.enableHMDTracking: Mainview fred from *hmd*.rb' vizact.removeEvent(self.mainViewUpdateAction) self.mainViewUpdateAction = False
def runPathSet(self, peopleset, ps, tophat, custom, timeline=None): print "here5" viztask.schedule(tophat.start_custom_walk()) if timeline != None: timeline.schedule(self.toggleAR) for person in peopleset: if custom: viztask.schedule(person.start_custom_walk()) else: viztask.schedule(person.walk_around()) ps = self.nextPath print "here6" self.num_nearby = 0 self.num_samples = 0 # nearby_timer = vizact.ontimer(1/speedMultiplier,self.checkNearby,tophat,peopleset) # visible_timer = vizact.ontimer(0.5/speedMultiplier,tophat.checkVisibleTime) # errlist = [] # error_timer = vizact.ontimer(0.1/speedMultiplier,self.checkError,tophat,errlist) # error_timer = vizact.onupdate(-10,self.checkError,tophat,errlist,timelist) print "here7" yield viztask.waitTime(self.taskTime) print "here8" # vizact.removeEvent(visible_timer) # vizact.removeEvent(nearby_timer) # vizact.removeEvent(error_timer) # save the path print "peopleSetLength:", len(peopleset) print "peopelPathsLenght:", len(ps.peoplePaths) for person in peopleset: ps.peoplePaths.append(person.get_path()) print "peopelPathsLenght:", len(ps.peoplePaths) ps.abePath = tophat.get_path() ps.speed = 0 for pt in ps.abePath.points: ps.speed += pt[1] ps.speed /= len(ps.abePath.points) ps.collisions = ps.abePath.collisions ps.timeNotVisible = tophat.timeNotVisible * speedMultiplier ps.pointsWalkedTo = len(ps.abePath.points) # ps.numberPeopleNearby = self.num_nearby / self.num_samples ps.quadrantsReached = ps.abePath.quadrantsReached print "num collisions: ", ps.collisions print "quadrants reached: ", ps.quadrantsReached print "points to which Abe walked: ", ps.pointsWalkedTo print "avg. speed: ", ps.speed print "time not visible: ", ps.timeNotVisible print "avg. num people nearby: ", ps.numberPeopleNearby # vizact.removeEvent(rpt) vizact.removeEvent(tophat.arev) tophat.arev = None # this is so we can pickle it tophat.pointAR.remove() tophat.avatar.clearActions() tophat.avatar.remove() tophat.hat.remove() tophat.stop() for person in peopleset: vizact.removeEvent(person.arev) person.arev = None person.pointAR.remove() person.avatar.clearActions() person.avatar.remove() person.stop()