本文整理汇总了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()