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


Python Camera.__init__方法代码示例

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


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

示例1: __init__

# 需要导入模块: from Camera import Camera [as 别名]
# 或者: from Camera.Camera import __init__ [as 别名]
    def __init__(self, physic_world, config=None):
        logging.info("INIT PLAYER...")
        logging.info("INIT FSM...")
        FSM.__init__(self, "FSM-Player")
        logging.info("INIT CONFIG...")
        Config.__init__(self)
        # additional initial configuration settings set by the outher application
        self.physic_world = physic_world
        logging.info("INIT PHYSICS...")
        Physics.__init__(self)
        logging.info("INIT CONTROLS...")
        Control.__init__(self)
        logging.info("INIT CAMERA...")
        Camera.__init__(
            self,
            self.cam_near_clip,
            self.cam_far_clip,
            self.cam_fov)
        logging.info("INIT ANIMATOR...")
        Animator.__init__(self)
        logging.info("INIT PLAYER DONE")

        #
        # STATES SETUP
        #
        self.on_ground_states = [
            self.STATE_IDLE,
            self.STATE_IDLE_TO_WALK,
            self.STATE_WALK,
            self.STATE_WALK_TO_IDLE,
            self.STATE_PLANT]
        # set the possible transition in the FSM
        self.defaultTransitions = {
            self.STATE_IDLE: [self.STATE_IDLE_TO_WALK, self.STATE_PLANT],
            self.STATE_IDLE_TO_WALK: [self.STATE_IDLE, self.STATE_WALK],
            self.STATE_WALK: [self.STATE_IDLE, self.STATE_WALK_TO_IDLE],
            self.STATE_WALK_TO_IDLE: [self.STATE_IDLE, self.STATE_WALK],
            self.STATE_PLANT: [self.STATE_IDLE],
            }

        #
        # ACTOR SETUP
        #
        Actor.__init__(
            self,
            self.model,
            {
                self.IDLE: self.anim_idle,
                self.WALK: self.anim_walk,
                self.PLANT: self.anim_plant,
            })
        self.setBlend(frameBlend=self.enable_interpolation)

        alphaSettings = ColorBlendAttrib.make(
            ColorBlendAttrib.MAdd,
            ColorBlendAttrib.OIncomingAlpha,
            ColorBlendAttrib.OOne,
            (0, 0, 0, 0))
        #self.setAttrib(alphaSettings)
        self.setBin("fixed", 15)
        self.setDepthWrite(False)

        #
        # CONTROLS SETUP
        #
        self.isDown = base.mouseWatcherNode.isButtonDown
        self.mainNode = self
开发者ID:grimfang,项目名称:pyweek21,代码行数:69,代码来源:Player.py

示例2: __init__

# 需要导入模块: from Camera import Camera [as 别名]
# 或者: from Camera.Camera import __init__ [as 别名]
 def __init__(self, w, h, limit_x, limit_y):
     Camera.__init__(self, w, h)
     self.x_speed = 3
     self.y_speed = 3
     self.limit_x = limit_x
     self.limit_y = limit_y
开发者ID:v0ided,项目名称:FirstPyGame,代码行数:8,代码来源:EditCamera.py


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