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


Python GameLogic.getAverageFrameRate方法代码示例

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


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

示例1: update

# 需要导入模块: import GameLogic [as 别名]
# 或者: from GameLogic import getAverageFrameRate [as 别名]
def update(faceServer, time_diff):
    """
    """
    global INFO_PERIOD

    cont = G.getCurrentController()
    eyes_done = False

    # threaded server is thread-safe
    for au, value in faceServer.update(time_diff):
        if au[0] == '6':        # XXX: yes, 6 is an eye prefix (do better ?)
            if eyes_done:
                continue
            # The model is supposed to look towards negative Y values
            # Also Up is positive Z values
            ax  = -faceServer.get_AU('63.5')[3]
            az0 = faceServer.get_AU('61.5R')[3]
            az1 = faceServer.get_AU('61.5L')[3]
            # No ACTION for eyes
            G.eye_L.localOrientation = [
                [cos(az0),        -sin(az0),         0],
                [cos(ax)*sin(az0), cos(ax)*cos(az0),-sin(ax)],
                [sin(ax)*sin(az0), sin(ax)*cos(az0), cos(ax)] ]
            G.eye_R.localOrientation = [
                [cos(az1),        -sin(az1),          0],
                [cos(ax)*sin(az1), cos(ax)*cos(az1),-sin(ax)],
                [sin(ax)*sin(az1), sin(ax)*cos(az1), cos(ax)] ]
            eyes_done = True
        elif au == '26':
            # TODO: try with G.setChannel
            G.jaw['p26'] = SH_ACT_LEN * value    # see always sensor in .blend
        elif au[0] == '9':      # XXX: yes, 6 is a tongue prefix (do better ?)
            G.tongue[au] = SH_ACT_LEN * value
        else:
            cont.owner['p'+au] = value * SH_ACT_LEN
            cont.activate(cont.actuators[au])

    INFO_PERIOD += time_diff
    if INFO_PERIOD > 5:
        print "--- RENDERING INFO ---"
        print "BGE logic running at", G.getLogicTicRate(), "fps."
#        print "BGE physics running at", G.getPhysicsTicRate(), "fps."
        print "BGE graphics currently at", G.getAverageFrameRate(), "fps."
        INFO_PERIOD = 0
开发者ID:Dfred,项目名称:concept-robot,代码行数:46,代码来源:__init__.py

示例2: fps

# 需要导入模块: import GameLogic [as 别名]
# 或者: from GameLogic import getAverageFrameRate [as 别名]
	def fps(self):
		"""The current fps"""
		return gl.getAverageFrameRate()
开发者ID:griusfux,项目名称:conceptrpg2,代码行数:5,代码来源:blender_wrapper.py


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