예제 #1
0
 def __init__(self):
     self.vector = three.Vector3(0, 0, 0)
     self.geo = three.Mesh(three.BoxGeometry(.25, .25, .25),
                           three.MeshBasicMaterial({'color': 0xffffff}))
     self.lifespan = 0
     self.momentum = three.Vector3(0, 0, 0)
     self.reset()
예제 #2
0
    def __init__(self, keyboard, game):
        Unit.__init__(self)
        self.keyboard = keyboard

        self.geo = three.Mesh(three.ConeBufferGeometry(1, 3, 8),
                              three.MeshNormalMaterial())
        exhaust = three.Mesh(three.ConeBufferGeometry(.5, 2, 8),
                             three.MeshBasicMaterial({'color': 0xffff00}))
        self.geo.add(exhaust)
        exhaust.translateY(-2)
        exhaust.rotateZ(3.14159)
        self.exhaust = exhaust
        self.momentum = three.Vector3(0, 0, 0)
        self.keyboard = keyboard
        self.bbox = AABB(2, 3, self.geo.position)
        self.game = game
예제 #3
0
 def __init__(self, radius, pos):
     Unit.__init__(self)
     self.radius = radius
     self.geo = three.Mesh(three.SphereGeometry(self.radius),
                           three.MeshNormalMaterial())
     self.geo.position.set(pos.x, pos.y, pos.z)
     self.bbox = AABB(self.radius * 2, self.radius * 2, self.geo.position)
     self.momentum = three.Vector3(0, 0, 0)