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


Python TransformState.getNumStates方法代码示例

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


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

示例1: update

# 需要导入模块: from panda3d.core import TransformState [as 别名]
# 或者: from panda3d.core.TransformState import getNumStates [as 别名]
    def update(self):
        if self.memUsageText:

            memstr = str(round(MemoryMonitor.getEstimatedMemUsage() / 1024.0 / 1024.0, 2))

            numTextureBytes = 0
            renderTextures = Globals.render.findAllTextures()
            for tex in renderTextures:
                numTextureBytes += MemoryMonitor._calculateTexSize(tex)

            texstr = str(round(numTextureBytes / 1024.0 / 1024.0, 2))

            otherTextures = TexturePool.findAllTextures()
            numOtherBytes = 0
            for tex in otherTextures:
                if tex not in renderTextures:
                    numOtherBytes += MemoryMonitor._calculateTexSize(tex)
            
            otherstr = str(round(numOtherBytes / 1024.0 / 1024.0, 2))

            self.memUsageText.setText("VRAM Usage: " + memstr + " MB / Textures: " + texstr + " MB / Other: " + otherstr + " MB")

        if self.fpsText:
            clock = Globals.clock
            self.fpsText.setText("Frame time over {:3.1f}s     Avg: {:3.2f}     Max: {:3.2f}     Deviation: {:3.2f}".format(
                clock.getAverageFrameRateInterval(), 
                1000.0 / clock.getAverageFrameRate(),
                clock.getMaxFrameDuration() * 1000.0,
                clock.calcFrameRateDeviation() * 1000.0
                ))

        if self.stateText:
            self.stateText.setText("{:6d} Render States, {:6d} Transform States".format(RenderState.getNumStates(), TransformState.getNumStates()))

        if self.perfOverlay:
            self.perfOverlay.update()
开发者ID:cesarmarinhorj,项目名称:RenderPipeline,代码行数:38,代码来源:PipelineGuiManager.py


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