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


Python Entity.setBounds方法代码示例

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


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

示例1: __init__

# 需要导入模块: from entities import Entity [as 别名]
# 或者: from entities.Entity import setBounds [as 别名]
    def __init__(self, scene, pos):
        Entity.__init__(self)
        self._destroyed = False
        self._closing = False

        self._scene = scene

        self.moveTo(pos)

        self._graphics = R.loadObject("targetpt.obj","diffuse")
        self._beacon = R.loadObject("beacon.obj","glow")

        self._anim_m = T.identity_matrix()
        self._rot= T.quaternion_about_axis(0, (0,0,1))
        self._rot_speed = T.quaternion_about_axis(0.01, (0,0,1))

        self._scale = 0.15

        self.moveTo(self.getPosition() + (0,0,-0.3))

        self._scale_m = T.scale_matrix(self._scale)

        bounds = self._graphics.getObj().getBounds() * self._scale

        Entity.setBounds(self,bounds)
开发者ID:Gato-X,项目名称:NotYourData,代码行数:27,代码来源:targetpoint.py

示例2: __init__

# 需要导入模块: from entities import Entity [as 别名]
# 或者: from entities.Entity import setBounds [as 别名]
    def __init__(self, scene, pos, dest, router):
        Entity.__init__(self)
        self._destroyed = False
        self._closing = False
        self._target_reached = False

        self._scene = scene
        self._map = scene.getMap()

        self._path = None

        self._dying_t = 0
        self._spin = 0

        self.moveTo(pos)

        self._scale = 1.0
        self._graphics = R.loadObject("enemy.obj","diffuse")
        self._orient_m= T.identity_matrix()

        self._xform_m = N.dot(T.rotation_matrix(math.pi/2,(0,0,1)),T.scale_matrix(self._scale))

        bounds = self._graphics.getObj().getBounds()

        router.requestJob(pos, dest, Enemy.OnRouteObtained, self)

        Entity.setBounds(self,bounds * self._scale)
        self._destroyed = False
        self._old_time = 0

        self._old_pos = None # At t-1
        self._old_pos2 = None # At t-2

        self._hc = HeadingController()
开发者ID:Gato-X,项目名称:NotYourData,代码行数:36,代码来源:enemy.py

示例3: __init__

# 需要导入模块: from entities import Entity [as 别名]
# 或者: from entities.Entity import setBounds [as 别名]
    def __init__(self, pos, particles):
        Entity.__init__(self)

        self._particles = particles

        self.moveTo(pos)

        self._graphics = R.loadObject("base.obj","diffuse")
        self._anim_m = T.identity_matrix()

        bounds = self._graphics.getObj().getBounds()

        Entity.setBounds(self,bounds)
开发者ID:Gato-X,项目名称:NotYourData,代码行数:15,代码来源:base.py

示例4: __init__

# 需要导入模块: from entities import Entity [as 别名]
# 或者: from entities.Entity import setBounds [as 别名]
    def __init__(self, scene, pos, direction, missile_type, follow):
        Entity.__init__(self)

        self._t0 = None
        self._follow = follow

        self._scene = scene

        self._map = scene.getMap()

        self.moveTo(pos)

        self._thrust = 0.01
        self._speed = 0.1

        self._destroyed = False

        self._graphics = R.loadObject(missile_type+".obj","diffuse")
        self._pos_m = T.translation_matrix(pos)


        axis = T.random_vector(3)

        self._d_rotation = T.quaternion_about_axis(0.01, axis)
        self._rotation = T.random_quaternion()

        self._dir = direction

        scale = 0.05

        self._scaling_m = T.scale_matrix(scale)

        bounds = self._graphics.getObj().getBounds() * scale

        Entity.setBounds(self,bounds)

        self._trail= ParticleGenerator("billboard","puff.jpg")
        self._trail.setEvolveTime(0.5)
        self._trail.setAcceleration(0)
        self._trail.setEasing(0.5, 0.5, 0.0, 0.05, 0.2)
        self._trail.setBrightness(0.5)

        pg = scene.getParticleManager()

        def em(t):
            while True:
                dx = 2.*random.random()-1.
                dy = 2.*random.random()-1.
                dz = 2.*random.random()-1.

                r = dx*dx+dy*dy+dz*dz

                if r < 1.0:
                    break

            return self._pos,(dx*0.2,dy*0.2,dz*0.2)

        self._trail.setEmitter(em)
        self._trail.setMode("DYNAMIC")

        pg.manageGenerator(self._trail)

        self._last_z = 0
开发者ID:Gato-X,项目名称:NotYourData,代码行数:65,代码来源:missile.py


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