def onSize(self, evt): """Invoked when the viewport is resized.""" WxPandaWindow.onSize(self, evt) if self.win != None: newWidth = self.ClientSize.GetWidth() newHeight = self.ClientSize.GetHeight() if hasattr(base, "direct") and base.direct: for dr in base.direct.drList: if dr.camNode == self.camNode: dr.updateFilmSize(newWidth, newHeight) break
def __init__(self, name, *args, **kwargs): self.name = name DirectObject.__init__(self) kwargs['gsg'] = ViewportManager.gsg WxPandaWindow.__init__(self, *args, **kwargs) ViewportManager.viewports.append(self) if ViewportManager.gsg == None: ViewportManager.gsg = self.win.getGsg() self.camera = None self.lens = None self.camPos = None self.camLookAt = None self.initialized = False self.grid = None self.collPlane = None