def __init__(self, IP, panda): self.threedee_math = threedee_math.threedee_math() self.panda = panda self.IP = IP self.x = {} self.panda.model.servers[IP] = True for i in self.panda.model.master_zone_array: for j in i: self.x[j] = 0 self.panda.model.servers[IP] = self.panda.loader.loadModel(getPath("model", "crt.egg")) self.rearrangeServers()
def __init__(self, camera, panda): self.threedee_math = threedee_math.threedee_math() self.camera = camera self.panda = panda self.orientation = "landscape" self.accept('y', self.Levitate) self.accept('y-repeat', self.Levitate) self.accept('h', self.Down) self.accept('h-repeat', self.Down) self.accept('q', self.spinLeft) self.accept('q-repeat', self.spinLeft) self.accept('e', self.spinRight) self.accept('e-repeat', self.spinRight) self.accept('x', self.Original) self.accept('z', self.slideLeft) self.accept('z-repeat', self.slideLeft) self.accept('c', self.slideRight) self.accept('c-repeat', self.slideRight) self.accept('shift-z', self.slideLeftFast) self.accept('shift-z-repeat', self.slideLeftFast) self.accept('shift-c', self.slideRightFast) self.accept('shift-c-repeat', self.slideRightFast) self.accept('r', self.tiltForward) self.accept('r-repeat', self.tiltForward) self.accept('f', self.tiltBack) self.accept('f-repeat', self.tiltBack) self.accept('b', self.jumpBack) self.accept('g', self.jumpUp) self.accept('t', self.rotateScene) self.accept('p', self.exampleSigns) self.accept('l', self.exampleMove) self.accept('o', self.exampleKill) self.accept('w', self.Forward) self.accept('w-repeat', self.Forward) self.accept('s', self.Backward) self.accept('s-repeat', self.Backward) self.accept('a', self.rotateLeft) self.accept('a-repeat', self.rotateLeft) self.accept('d', self.rotateRight) self.accept('d-repeat', self.rotateRight)
def __init__(self, conf_file): if not conf_file: conf_file = 'None' self.configuration = config.ConfigFile(conf_file) self.threedee_math = threedee_math.threedee_math() self.master_zone_array = [] self.security_zones = self.configuration.zone_list() print self.security_zones self.zone_list = self.security_zones.split(',') for i in self.zone_list: temp_array = self.configuration.subnet(i).split(',') self.master_zone_array.append(temp_array) self.x = {} self.servers = {} self.names = {} for i in self.master_zone_array: for j in i: self.x[j] = 0
def __init__(self, camera, panda, conf_file): if not conf_file: conf_file = 'None' print conf_file self.configuration = config.ConfigFile(conf_file) self.camera = camera self.panda = panda self.view = self.panda.subnetview if self.configuration.skyshape(): try: skybox_model = getPath("model", self.configuration.skyshape()) except: skybox_model = None if not skybox_model: skybox_model = getPath("model", "skybox.egg") print skybox_model try: self.skybox = self.panda.loader.loadModel(skybox_model) except: #traceback.print_exc() print "Skybox Model not found" if self.configuration.skybox_texture(): try: texture = getPath("image", self.configuration.skybox_texture()) except: texture = None if not texture: texture=getPath("image", "sky.jpg") try: self.skyboxTexture = self.panda.loader.loadTexture(texture) except: print "Skybox texture not found." self.skyboxTexture.setWrapU(Texture.WMRepeat) self.skyboxTexture.setWrapV(Texture.WMRepeat) self.skybox.setTexture(self.skyboxTexture, 1) self.skybox.reparentTo(self.view) self.skybox.setScale(100) self.skybox.setH(30) self.camera.setX(-20) plight = DirectionalLight('my plight') plnp = self.view.attachNewNode(plight) plnp.setHpr(310, 0 ,30) self.view.setLight(plnp) alight = AmbientLight('alight') alight.setColor(VBase4(0.4, 0.4, 0.4, 1)) alnp = self.view.attachNewNode(alight) self.view.setLight(alnp) self.threedee_math = threedee_math.threedee_math() self.master_zone_array = [] self.security_zones = self.configuration.zone_list() print self.security_zones self.zone_list = self.security_zones.split(',') for i in self.zone_list: temp_array = self.configuration.subnet(i).split(',') self.master_zone_array.append(temp_array) self.x = {} for i in self.master_zone_array: self.x[self.master_zone_array.index(i)] = 0 self.subnets = {} self.cidrs = {} self.map_subnets()