parameters: (self, win, sort = 0, scene = None,
                     displayRegion = (0, 1, 0, 1), stereo = None,
                     aspectRatio = None, clearDepth = 0, clearColor = None,
                     lens = None, camName = 'cam', mask = None,
                     useCamera = None)
return_statement: return cam
docstring: Makes a new 3-d camera associated with the indicated window,
          and creates a display region in the indicated subrectangle.
  
          If stereo is True, then a stereo camera is created, with a
          pair of DisplayRegions.  If stereo is False, then a standard
          camera is created.  If stereo is None or omitted, a stereo
          camera is created if the window says it can render in stereo.
  
          If useCamera is not None, it is a NodePath to be used as the
          camera to apply to the window, rather than creating a new
          camera.
  
          :rtype: panda3d.core.NodePath
docstring_summary: Makes a new 3-d camera associated with the indicated window,
          and creates a display region in the indicated subrectangle.
docstring_tokens: Makes a new 3 - d camera associated with the indicated window and creates a display region in the indicated subrectangle .
function: def makeCamera(self, win, sort = 0, scene = None,
                     displayRegion = (0, 1, 0, 1), stereo = None,
                     aspectRatio = None, clearDepth = 0, clearColor = None,
                     lens = None, camName = 'cam', mask = None,
                     useCamera = None):
          """
          Makes a new 3-d camera associated with the indicated window,
          and creates a display region in the indicated subrectangle.
  
          If stereo is True, then a stereo camera is created, with a
          pair of DisplayRegions.  If stereo is False, then a standard
          camera is created.  If stereo is None or omitted, a stereo
          camera is created if the window says it can render in stereo.
  
          If useCamera is not None, it is a NodePath to be used as the
          camera to apply to the window, rather than creating a new
          camera.
  
          :rtype: panda3d.core.NodePath
          """
          # self.camera is the parent node of all cameras: a node that
          # we can move around to move all cameras as a group.
          if self.camera is None:
              # We make it a ModelNode with the PTLocal flag, so that
              # a wayward flatten operations won't attempt to mangle the
              # camera.
              self.camera = self.render.attachNewNode(ModelNode('camera'))
              self.camera.node().setPreserveTransform(ModelNode.PTLocal)
              builtins.camera = self.camera
  
              self.mouse2cam.node().setNode(self.camera.node())
  
          if useCamera:
              # Use the existing camera node.
              cam = useCamera
              camNode = useCamera.node()
              assert isinstance(camNode, Camera)
              lens = camNode.getLens()
              cam.reparentTo(self.camera)
  
          else:
              # Make a new Camera node.
              camNode = Camera(camName)
              if lens is None:
                  lens = PerspectiveLens()
  
                  if aspectRatio is None:
                      aspectRatio = self.getAspectRatio(win)
                  lens.setAspectRatio(aspectRatio)
  
              cam = self.camera.attachNewNode(camNode)
  
          if lens is not None:
              camNode.setLens(lens)
  
          if scene is not None:
              camNode.setScene(scene)
  
          if mask is not None:
              if isinstance(mask, int):
                  mask = BitMask32(mask)
              camNode.setCameraMask(mask)
  
          if self.cam is None:
              self.cam = cam
              self.camNode = camNode
              self.camLens = lens
  
          self.camList.append(cam)
  
          # Now, make a DisplayRegion for the camera.
          if stereo is not None:
              if stereo:
                  dr = win.makeStereoDisplayRegion(*displayRegion)
              else:
                  dr = win.makeMonoDisplayRegion(*displayRegion)
          else:
              dr = win.makeDisplayRegion(*displayRegion)
  
          dr.setSort(sort)
  
          # By default, we do not clear 3-d display regions (the entire
          # window will be cleared, which is normally sufficient).  But
          # we will if clearDepth is specified.
          if clearDepth:
              dr.setClearDepthActive(1)
  
          if clearColor:
              dr.setClearColorActive(1)
              dr.setClearColor(clearColor)
  
          dr.setCamera(cam)
  
          return cam
function_tokens: def makeCamera ( self , win , sort = 0 , scene = None , displayRegion = ( 0 , 1 , 0 , 1 ) , stereo = None , aspectRatio = None , clearDepth = 0 , clearColor = None , lens = None , camName = 'cam' , mask = None , useCamera = None ) : # self.camera is the parent node of all cameras: a node that # we can move around to move all cameras as a group. if self . camera is None : # We make it a ModelNode with the PTLocal flag, so that # a wayward flatten operations won't attempt to mangle the # camera. self . camera = self . render . attachNewNode ( ModelNode ( 'camera' ) ) self . camera . node ( ) . setPreserveTransform ( ModelNode . PTLocal ) builtins . camera = self . camera self . mouse2cam . node ( ) . setNode ( self . camera . node ( ) ) if useCamera : # Use the existing camera node. cam = useCamera camNode = useCamera . node ( ) assert isinstance ( camNode , Camera ) lens = camNode . getLens ( ) cam . reparentTo ( self . camera ) else : # Make a new Camera node. camNode = Camera ( camName ) if lens is None : lens = PerspectiveLens ( ) if aspectRatio is None : aspectRatio = self . getAspectRatio ( win ) lens . setAspectRatio ( aspectRatio ) cam = self . camera . attachNewNode ( camNode ) if lens is not None : camNode . setLens ( lens ) if scene is not None : camNode . setScene ( scene ) if mask is not None : if isinstance ( mask , int ) : mask = BitMask32 ( mask ) camNode . setCameraMask ( mask ) if self . cam is None : self . cam = cam self . camNode = camNode self . camLens = lens self . camList . append ( cam ) # Now, make a DisplayRegion for the camera. if stereo is not None : if stereo : dr = win . makeStereoDisplayRegion ( * displayRegion ) else : dr = win . makeMonoDisplayRegion ( * displayRegion ) else : dr = win . makeDisplayRegion ( * displayRegion ) dr . setSort ( sort ) # By default, we do not clear 3-d display regions (the entire # window will be cleared, which is normally sufficient).  But # we will if clearDepth is specified. if clearDepth : dr . setClearDepthActive ( 1 ) if clearColor : dr . setClearColorActive ( 1 ) dr . setClearColor ( clearColor ) dr . setCamera ( cam ) return cam