當前位置: 首頁>>代碼示例>>Python>>正文


Python SmoothMover.setMaxPositionAge方法代碼示例

本文整理匯總了Python中pandac.PandaModules.SmoothMover.setMaxPositionAge方法的典型用法代碼示例。如果您正苦於以下問題:Python SmoothMover.setMaxPositionAge方法的具體用法?Python SmoothMover.setMaxPositionAge怎麽用?Python SmoothMover.setMaxPositionAge使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在pandac.PandaModules.SmoothMover的用法示例。


在下文中一共展示了SmoothMover.setMaxPositionAge方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的Python代碼示例。

示例1: ProgressiveLoader

# 需要導入模塊: from pandac.PandaModules import SmoothMover [as 別名]
# 或者: from pandac.PandaModules.SmoothMover import setMaxPositionAge [as 別名]

#.........這裏部分代碼省略.........
        self.camLens.setFar(sys.maxint)
        self.camLens.setNear(8.0)
        self.render.setAntialias(p3d.AntialiasAttrib.MAuto)
        
        self.showstats = showstats
        if showstats:
            self.num_metadata_loaded = 0
            self.num_models_loaded = 0
            self.num_texture_updates = 0
            self.num_mesh_refinements = 0
            self.total_texture_updates = 0
            self.total_mesh_refinements = 0
            
            self.txtMetadataLoaded = gui.OnscreenText.OnscreenText(text='', style=1, pos=(0.01, -0.05),
                                                                 parent=self.a2dTopLeft, align=p3d.TextNode.ALeft,
                                                                 scale=0.05, fg=(0.1, 0.1, 0.1, 1), shadow=(0.9, 0.9, 0.9, 1))
            self.txtUniqueLoaded = gui.OnscreenText.OnscreenText(text='', style=1, pos=(0.01, -0.11),
                                                                 parent=self.a2dTopLeft, align=p3d.TextNode.ALeft,
                                                                 scale=0.05, fg=(0.1, 0.1, 0.1, 1), shadow=(0.9, 0.9, 0.9, 1))
            self.txtTextureUpdates = gui.OnscreenText.OnscreenText(text='', style=1, pos=(0.01, -0.17),
                                                                 parent=self.a2dTopLeft, align=p3d.TextNode.ALeft,
                                                                 scale=0.05, fg=(0.1, 0.1, 0.1, 1), shadow=(0.9, 0.9, 0.9, 1))
            self.txtMeshRefinements = gui.OnscreenText.OnscreenText(text='', style=1, pos=(0.01, -0.23),
                                                                 parent=self.a2dTopLeft, align=p3d.TextNode.ALeft,
                                                                 scale=0.05, fg=(0.1, 0.1, 0.1, 1), shadow=(0.9, 0.9, 0.9, 1))
            
            self.update_stats()
        
        self.globalClock = p3d.ClockObject.getGlobalClock()
        
        self.smooth_mover = SmoothMover()
        self.smooth_mover.setPredictionMode(SmoothMover.PMOn)
        self.smooth_mover.setSmoothMode(SmoothMover.SMOn)
        self.smooth_mover.setMaxPositionAge(10.0)
        self.smooth_mover.setAcceptClockSkew(False)
        self.smooth_mover.setDelay(0)
        
        self.pandastate = katasked.panda.PandaState(self.cam,
                                                    self.unique_nodepaths,
                                                    self.nodepaths,
                                                    self.smooth_mover,
                                                    self.globalClock,
                                                    self.obj_bounds)
        
        if self.capturefile is not None:
            self.capturedata = json.load(self.capturefile)
            self.duration = self.capturedata['duration']
            self.positions = self.capturedata['positions']
            self.rotations = self.capturedata['rotations']
            
            self.curve_creator = motioncap.CreateNurbsCurve()
            for pos, rot in zip(self.positions, self.rotations):
                self.curve_creator.addPoint(pos, rot)
            self.mopath = self.curve_creator.getMotionPath()
            
            self.interval = MopathInterval.MopathInterval(self.mopath, self.cam, duration=self.duration, name="Camera Replay")
        else:
            controls.KeyboardMovement()
            controls.MouseCamera()
        
        self.update_camera_predictor_task = self.taskMgr.doMethodLater(0.1, self.update_camera_predictor, 'update_camera_predictor')
        self.update_priority_task = self.taskMgr.doMethodLater(0.5, self.check_pool, 'check_pool')
        self.load_waiting_task = self.taskMgr.doMethodLater(0.1, self.load_waiting, 'load_waiting')
        
    def run(self):
        if self.screenshot_dir is not None:
開發者ID:sirikata,項目名稱:progressive-scheduler,代碼行數:70,代碼來源:loader.py


注:本文中的pandac.PandaModules.SmoothMover.setMaxPositionAge方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。