def setupControls(self, avatarRadius = 1.4, floorOffset = OTPGlobals.FloorOffset, reach = 4.0, wallBitmask = OTPGlobals.WallBitmask, floorBitmask = OTPGlobals.FloorBitmask, ghostBitmask = OTPGlobals.GhostBitmask): walkControls = GravityWalker(legacyLifter=self.wantLegacyLifter()) walkControls.setWallBitMask(wallBitmask) walkControls.setFloorBitMask(floorBitmask) walkControls.initializeCollisions(self.cTrav, self, avatarRadius, floorOffset, reach) walkControls.setAirborneHeightFunc(self.getAirborneHeight) self.controlManager.add(walkControls, 'walk') self.physControls = walkControls twoDControls = TwoDWalker() twoDControls.setWallBitMask(wallBitmask) twoDControls.setFloorBitMask(floorBitmask) twoDControls.initializeCollisions(self.cTrav, self, avatarRadius, floorOffset, reach) twoDControls.setAirborneHeightFunc(self.getAirborneHeight) self.controlManager.add(twoDControls, 'twoD') swimControls = SwimWalker() swimControls.setWallBitMask(wallBitmask) swimControls.setFloorBitMask(floorBitmask) swimControls.initializeCollisions(self.cTrav, self, avatarRadius, floorOffset, reach) swimControls.setAirborneHeightFunc(self.getAirborneHeight) self.controlManager.add(swimControls, 'swim') ghostControls = GhostWalker() ghostControls.setWallBitMask(ghostBitmask) ghostControls.setFloorBitMask(floorBitmask) ghostControls.initializeCollisions(self.cTrav, self, avatarRadius, floorOffset, reach) ghostControls.setAirborneHeightFunc(self.getAirborneHeight) self.controlManager.add(ghostControls, 'ghost') observerControls = ObserverWalker() observerControls.setWallBitMask(ghostBitmask) observerControls.setFloorBitMask(floorBitmask) observerControls.initializeCollisions(self.cTrav, self, avatarRadius, floorOffset, reach) observerControls.setAirborneHeightFunc(self.getAirborneHeight) self.controlManager.add(observerControls, 'observer') self.controlManager.use('walk', self) self.controlManager.disable()