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