当前位置: 首页>>代码示例>>Python>>正文


Python SmoothMover.setAcceptClockSkew方法代码示例

本文整理汇总了Python中pandac.PandaModules.SmoothMover.setAcceptClockSkew方法的典型用法代码示例。如果您正苦于以下问题:Python SmoothMover.setAcceptClockSkew方法的具体用法?Python SmoothMover.setAcceptClockSkew怎么用?Python SmoothMover.setAcceptClockSkew使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在pandac.PandaModules.SmoothMover的用法示例。


在下文中一共展示了SmoothMover.setAcceptClockSkew方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的Python代码示例。

示例1: ProgressiveLoader

# 需要导入模块: from pandac.PandaModules import SmoothMover [as 别名]
# 或者: from pandac.PandaModules.SmoothMover import setAcceptClockSkew [as 别名]

#.........这里部分代码省略.........
        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:
            self.start_time = None
开发者ID:sirikata,项目名称:progressive-scheduler,代码行数:70,代码来源:loader.py


注:本文中的pandac.PandaModules.SmoothMover.setAcceptClockSkew方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。