Пример #1
0
    def test_group_system(self):
        import lepton
        from lepton import ParticleGroup
        # By default the group should be added to the global system
        group = ParticleGroup()
        self.failUnless(group in lepton.default_system)
        lepton.default_system.add_group(group)

        # We should be able to override the system by argument
        test_system = TestSystem()
        group = ParticleGroup(system=test_system)
        self.failUnless(group in test_system)
        self.failIf(group in lepton.default_system)

        # If the global system is overridden, the group should respect that
        original_system = lepton.default_system
        try:
            lepton.default_system = test_system
            group = ParticleGroup()
            self.failUnless(group in test_system)
        finally:
            lepton.default_system = original_system

        # If None is specified for system, group is not added
        group = ParticleGroup(system=None)
        self.failIf(group in lepton.default_system)
        self.failIf(group in test_system)
Пример #2
0
    def test_PerParticleEmitter_template(self):
        from lepton import Particle, ParticleGroup
        from lepton.emitter import PerParticleEmitter

        source_group = ParticleGroup()
        source_group.new(Particle(position=(1, 1, 1)))
        source_group.new(Particle(position=(2, 2, 2)))
        source_group.update(0)

        emitter = PerParticleEmitter(source_group,
                                     rate=1,
                                     template=Particle(position=(1.0, 1.0,
                                                                 1.0),
                                                       velocity=(0, 5, 2),
                                                       color=(0.5, 0.5, 0.5,
                                                              1.0)))
        group = ParticleGroup()
        count = emitter(1, group)
        group.update(0)
        self.assertEqual(count, len(source_group))
        self.assertEqual(len(group), len(source_group))
        particle = list(group)[0]
        self.assertVector(particle.position, (1, 1, 1))
        self.assertVector(particle.velocity, (0, 5, 2))
        self.assertColor(particle.color, (0.5, 0.5, 0.5, 1.0))
        particle = list(group)[1]
        self.assertVector(particle.position, (2, 2, 2))
        self.assertVector(particle.velocity, (0, 5, 2))
        self.assertColor(particle.color, (0.5, 0.5, 0.5, 1.0))
Пример #3
0
class Kaboom:
    lifetime = 0.6

    color = (0.9, 0.6, 0.2, 0.3)

    spark_tex = pyglet.resource.texture('bullet.png')
    spark_texturizer = SpriteTexturizer(spark_tex.id)

    sparks = ParticleGroup(controllers=[
        Lifetime(lifetime),
        Movement(damping=0.93),
        ColorBlender([(0, (1, 1, 1, 1)), (lifetime * 0.8, color),
                      (lifetime, color)]),
        Fader(fade_out_start=0.3, fade_out_end=lifetime),
    ],
                           renderer=BillboardRenderer(spark_texturizer))

    trails = ParticleGroup(controllers=[
        Lifetime(lifetime * 1.5),
        Movement(damping=0.83),
        ColorBlender([(0, (1, 1, 1, 1)), (1, color), (lifetime, color)]),
        Fader(max_alpha=0.75, fade_out_start=0, fade_out_end=lifetime),
    ],
                           renderer=BillboardRenderer(spark_texturizer))

    splosions = set()

    def __init__(self, position):
        x, y = position

        spark_emitter = StaticEmitter(
            template=Particle(position=(uniform(x - 5,
                                                x + 5), uniform(y - 5,
                                                                y + 5), 0),
                              size=(10, ) * 3,
                              color=self.color),
            deviation=Particle(velocity=(gauss(0, 5), gauss(0, 5), 0),
                               age=1.5),
            velocity=domain.Sphere((0, gauss(40, 20), 0), 60, 60))

        spark_emitter.emit(int(gauss(60, 40)) + 50, self.sparks)

        spread = abs(gauss(0.4, 1.0))
        self.trail_emitter = PerParticleEmitter(
            self.sparks,
            rate=uniform(5, 30),
            template=Particle(size=(6, ) * 3, color=self.color),
            deviation=Particle(velocity=(spread, spread, spread),
                               age=self.lifetime * 0.75))

        self.trails.bind_controller(self.trail_emitter)
        self.splosions.add(self)
        pyglet.clock.schedule_once(self.die, self.lifetime)

    def die(self, dt=None):
        self.trails.unbind_controller(self.trail_emitter)
        self.splosions.remove(self)
Пример #4
0
    def test_PerParticleEmitter_emit_empty_source(self):
        from lepton import ParticleGroup
        from lepton.emitter import PerParticleEmitter

        emitter = PerParticleEmitter(ParticleGroup())
        group = ParticleGroup()
        self.assertEqual(len(group), 0)
        emitter.emit(10, group)
        group.update(0)
        self.assertEqual(len(group), 0)
Пример #5
0
    def __init__(self):
        color = (uniform(0, 1), uniform(0, 1), uniform(0, 1), 1)
        while max(color[:3]) < 0.9:
            color = (uniform(0, 1), uniform(0, 1), uniform(0, 1), 1)

        spark_emitter = StaticEmitter(
            template=Particle(position=(uniform(-50, 50), uniform(-30, 30),
                                        uniform(-30, 30)),
                              color=color),
            deviation=Particle(velocity=(gauss(0, 5), gauss(0, 5), gauss(0,
                                                                         5)),
                               age=1.5),
            velocity=domain.Sphere((0, gauss(40, 20), 0), 60, 60))

        self.sparks = ParticleGroup(controllers=[
            Lifetime(self.lifetime * 0.75),
            Movement(damping=0.93),
            ColorBlender([(0, (1, 1, 1, 1)), (2, color),
                          (self.lifetime, color)]),
            Fader(fade_out_start=1.0, fade_out_end=self.lifetime * 0.5),
        ],
                                    renderer=PointRenderer(
                                        abs(gauss(10, 3)), spark_texturizer))

        spark_emitter.emit(int(gauss(60, 40)) + 50, self.sparks)

        spread = abs(gauss(0.4, 1.0))
        self.trail_emitter = PerParticleEmitter(
            self.sparks,
            rate=uniform(5, 30),
            template=Particle(color=color),
            deviation=Particle(velocity=(spread, spread, spread),
                               age=self.lifetime * 0.75))

        self.trails = ParticleGroup(controllers=[
            Lifetime(self.lifetime * 1.5),
            Movement(damping=0.83),
            ColorBlender([(0, (1, 1, 1, 1)), (1, color),
                          (self.lifetime, color)]),
            Fader(max_alpha=0.75,
                  fade_out_start=0,
                  fade_out_end=gauss(self.lifetime, self.lifetime * 0.3)),
            self.trail_emitter
        ],
                                    renderer=PointRenderer(
                                        10, trail_texturizer))

        pyglet.clock.schedule_once(self.die, self.lifetime * 2)
Пример #6
0
    def test_StaticEmitter_discrete(self):
        from lepton import Particle, ParticleGroup
        from lepton.emitter import StaticEmitter

        masses = (0.5, 2.0, 8.0)
        positions = ((1.0, 1.0, 1.0), (10.0, 20.0, 30.0), (-100.0, 0.0, 0.0))
        velocities = ((1, 1, 0), )
        colors = ((1.0, 1.0, 1.0, 0.5), (1.0, 0, 0, 1.0), (0, 1.0, 0, 1.0))
        emitter = StaticEmitter(rate=1,
                                mass=masses,
                                position=positions,
                                velocity=velocities,
                                color=colors)
        group = ParticleGroup()
        emitter(3, group)
        group.update(0)
        self.assertEqual(len(group), 3)
        for particle in group:
            self.failUnless(particle.mass in masses, (particle.mass, masses))
            self.failUnless(
                tuple(particle.position) in positions,
                (particle.position, positions))
            self.failUnless(
                tuple(particle.color) in colors, (particle.color, colors))
            self.assertVector(particle.velocity, (1, 1, 0))
Пример #7
0
    def test_bind_controllers(self):
        from lepton import ParticleGroup
        ctrl1 = TestController()
        ctrl2 = TestController()
        ctrl3 = TestController()
        ctrl4 = TestController()
        group = ParticleGroup()
        self.failIf(group.controllers)

        # Can bind controllers in constructor and after
        group = ParticleGroup(controllers=(ctrl1, ctrl2))
        self.assertEqual(tuple(group.controllers), (ctrl1, ctrl2))
        group.bind_controller(ctrl3, ctrl4)
        self.assertEqual(tuple(group.controllers),
                         (ctrl1, ctrl2, ctrl3, ctrl4))
        '''
Пример #8
0
class Impact:
    lifetime = 0.5

    color = (0.9, 0.6, 0.2, 0.3)

    spark_tex = pyglet.resource.texture('bullet.png')
    spark_texturizer = SpriteTexturizer(spark_tex.id)

    sparks = ParticleGroup(controllers=[
        Lifetime(lifetime),
        Movement(),
        ColorBlender([(0, (1, 1, 1, 1)), (lifetime * 0.8, color),
                      (lifetime, (0, 0, 0, 0))]),
    ],
                           renderer=BillboardRenderer(spark_texturizer))

    @classmethod
    def emit(cls, position, velocity):
        x, y = position + velocity * 0.3
        emitter = StaticEmitter(template=Particle(position=(x, y, 0),
                                                  size=(5, ) * 3,
                                                  color=cls.color),
                                deviation=Particle(age=0.2),
                                velocity=domain.Disc((*-2 * velocity, 0),
                                                     (0, 0, 1), 100))

        emitter.emit(10, cls.sparks)
Пример #9
0
class Debris:
    lifetime = 0.5

    color = (1.0, 1.0, 1.0, 1.0)

    fragment_tex = pyglet.resource.texture('fragment.png')
    fragment_texturizer = SpriteTexturizer(fragment_tex.id)

    fragments = ParticleGroup(controllers=[
        Lifetime(lifetime),
        Movement(),
    ],
                              renderer=BillboardRenderer(fragment_texturizer),
                              system=diffuse_system)

    @classmethod
    def emit(cls, position):
        emitter = StaticEmitter(template=Particle(position=(*position, 0),
                                                  size=(16, ) * 3,
                                                  rotation=(0, 0, 1),
                                                  color=cls.color),
                                deviation=Particle(age=0.2,
                                                   rotation=(0, 0, 2)),
                                velocity=domain.Disc((0, 0, 0), (0, 0, 1),
                                                     100))

        emitter.emit(20, cls.fragments)
Пример #10
0
    def __init__(self, x, y, direction):
        self.x, self.y = (x, y)
        self.direction = direction
        if direction < 0: self.speed = -800
        else: self.speed = 800

        self.emitter = emitter.StaticEmitter(
          rate=300,
          template=Particle(
              position=(x, y, 0),
              velocity=(0, 0, 0),
              color=(1, 1, 0, 0.5),
              size=(8, 8, 0),
              # rotation?
              # up?
          ),
          velocity=Disc((0,0,0), (0,0,1), 200),
          time_to_live=self.duration,
        )
        self.fader = controller.Fader(start_alpha=1,fade_out_start=0,fade_out_end=.5,end_alpha=0)

        self.group = ParticleGroup(
            controllers=[
                self.emitter,
                controller.Gravity((0, -100, 0)),
                controller.Movement(),
                self.fader,
                controller.Lifetime(1),
            ],
            renderer=Render('zap-star.png'),
        )
        self.emitter.emit(1, self.group)
Пример #11
0
    def test_PerParticleEmitter_invalid_rate(self):
        from lepton import Particle, ParticleGroup
        from lepton.emitter import PerParticleEmitter

        self.assertRaises(ValueError,
                          PerParticleEmitter,
                          ParticleGroup(),
                          rate=-1)
Пример #12
0
 def create_group(self, controllers, texture):
     particlegroup = ParticleGroup(controllers=controllers,
                                   system=self.system)
     texturizer = SpriteTexturizer(texture.id)
     particlegroup.renderer = BillboardRenderer(texturizer)
     self.textures.add(
         texture)  # hold a reference to this, otherwise it will get deleted
     return particlegroup
Пример #13
0
 def _make_group(self):
     from lepton import Particle, ParticleGroup
     g = ParticleGroup()
     g.new(Particle((0, 0, 0), (0, 0, 0)))
     g.new(Particle((0, 0, 0), (1, 1, 1), size=(2, 2, 2)))
     g.new(Particle((1, 1, 1), (-2, -2, -2), size=(3, 2, 0)))
     g.update(0)
     return g
Пример #14
0
    def test_set_renderer(self):
        from lepton import ParticleGroup
        renderer = TestRenderer()
        group = ParticleGroup()
        self.assertEqual(group.renderer, None)

        # Can set renderer after init
        group.renderer = renderer
        self.assertEqual(group.renderer, renderer)

        # Can set renderer at init
        group2 = ParticleGroup(renderer=renderer)
        self.assertEqual(group2.renderer, renderer)

        # Can set renderer back to None
        group.renderer = None
        self.assertEqual(renderer.group, None)
Пример #15
0
    def explosion(self, pos, magnitude):

        sparks = ParticleGroup(
          controllers=[
              Lifetime(3),
              Movement(damping=0.93),
              Fader(fade_out_start=0.75, fade_out_end=3.0),
          ],
          renderer=BillboardRenderer(SpriteTexturizer(self.particle1_tex.id)))

        spark_emitter = StaticEmitter(
          template=Particle(
              position=(pos[0], pos[1], 0),
              color=(1, 1, 1)),
          deviation=Particle(
              position=(1, 1, 0),
              velocity=(300, 300, 0),
              age=1.5),
          size=[(3, 3, 0), (4, 4, 0), (5, 5, 0), (5, 5, 0), (6, 6, 0), (7, 7, 0)])
        spark_emitter.emit(magnitude, sparks)

        fire = ParticleGroup(
          controllers=[
              Lifetime(2),
              Movement(damping=0.95),
              Growth(60),
              Fader(fade_in_start=0, start_alpha=0, fade_in_end=0.5, max_alpha=0.6,
                    fade_out_start=1.0, fade_out_end=2.0)
          ],
          renderer=BillboardRenderer(SpriteTexturizer(self.smoke1_tex.id)))

        fire_emitter = StaticEmitter(
          template=Particle(
              position=(pos[0], pos[1], 0),
              size=(50, 50, 0)),
          deviation=Particle(
              position=(0.5, 0.5, 0),
              velocity=(70, 70, 0),
              size=(20, 20, 0),
              up=(0, 0, math.pi * 2),
              rotation=(0, 0, math.pi * 0.06),
              age=2, ),
          color=[(0.5, 0, 0), (0.5, 0.5, 0.5), (0.4, 0.1, 0.1), (0.85, 0.3, 0)],
        )
        fire_emitter.emit(400, fire)
Пример #16
0
    def __init__(self, *args):
        super(Rocket, self).__init__(*args)
        psystem = self.squid.world.particles
        self.particlegroup = ParticleGroup(
            renderer=self.particle_renderer,
            controllers=self.particle_controllers,
            system=psystem)

        self.emitter = None
Пример #17
0
 def _make_group(self):
     from lepton import Particle, ParticleGroup
     g = ParticleGroup()
     g.new(Particle(position=(0, 1.0, 0), velocity=(0, 0, 0))),
     g.new(Particle(position=(0, 0, 1.0), velocity=(0, 0, 0))),
     g.update(0)
     p = list(g)
     p[0].position = (10.0, 0, 0)
     p[1].position = (0, 0.0, 10.0)
     return g
Пример #18
0
    def test_PerParticleEmitter_partial(self):
        from lepton import Particle, ParticleGroup
        from lepton.emitter import PerParticleEmitter

        source_group = ParticleGroup()
        source_group.new(object())
        source_group.new(object())
        source_group.new(object())
        source_group.update(0)

        emitter = PerParticleEmitter(source_group, rate=1)
        group = ParticleGroup()
        # It should take four quarter second updates to emit any
        self.assertEqual(emitter(0.25, group), 0)
        self.assertEqual(emitter(0.25, group), 0)
        self.assertEqual(emitter(0.25, group), 0)
        self.assertEqual(emitter(0.25, group), len(source_group))
        group.update(0)
        self.assertEqual(len(group), len(source_group))
Пример #19
0
 def test_particle_vector_clamp(self):
     from lepton import ParticleGroup
     group = ParticleGroup()
     p = TestParticle()
     p.color = (2, 0.5, -1, 5)
     p.size = (0, 2, 0)
     newp = group.new(p)
     self.assertEqual(tuple(newp.color), p.color)
     self.assertEqual(tuple(newp.size), p.size)
     self.assertEqual(tuple(newp.color.clamp(0, 1)), (1, 0.5, 0, 1))
     self.assertEqual(tuple(newp.size.clamp(1, 1.5)), (1, 1.5, 1))
Пример #20
0
 def test_len(self):
     from lepton import ParticleGroup
     group = ParticleGroup()
     self.assertEqual(len(group), 0)
     group.new(TestParticle())
     self.assertEqual(len(group), 0)
     group.new(TestParticle())
     self.assertEqual(len(group), 0)
     # New particles become visible on update
     group.update(0)
     self.assertEqual(len(group), 2)
Пример #21
0
    def test_PerParticleEmitter_emit(self):
        from lepton import ParticleGroup
        from lepton.emitter import PerParticleEmitter

        source_group = ParticleGroup()
        source_group.new(object())
        source_group.new(object())
        source_group.new(object())
        source_group.update(0)

        emitter = PerParticleEmitter(source_group)
        group = ParticleGroup()
        self.assertEqual(len(group), 0)
        emitter.emit(10, group)
        group.update(0)
        expected = 10 * len(source_group)
        self.assertEqual(len(group), expected)

        # Negative emit value is equivilant to zero
        emitter.emit(-10, group)
        group.update(0)
        self.assertEqual(len(group), expected)
Пример #22
0
    def test_StaticEmitter_partial(self):
        from lepton import Particle, ParticleGroup
        from lepton.emitter import StaticEmitter

        emitter = StaticEmitter(rate=1)
        group = ParticleGroup()
        # It should take four quarter second updates to emit one
        self.assertEqual(emitter(0.25, group), 0)
        self.assertEqual(emitter(0.25, group), 0)
        self.assertEqual(emitter(0.25, group), 0)
        self.assertEqual(emitter(0.25, group), 1)
        group.update(0)
        self.assertEqual(len(group), 1)
Пример #23
0
 def test_unbind_controllers(self):
     from lepton import ParticleGroup
     ctrl1 = TestController()
     ctrl2 = TestController()
     group = ParticleGroup(controllers=(ctrl1, ctrl2))
     self.failUnless(ctrl1 in group.controllers)
     self.failUnless(ctrl2 in group.controllers)
     group.unbind_controller(ctrl1)
     self.failUnless(ctrl1 not in group.controllers)
     self.failUnless(ctrl2 in group.controllers)
     group.unbind_controller(ctrl2)
     self.failUnless(ctrl1 not in group.controllers)
     self.failUnless(ctrl2 not in group.controllers)
     self.assertRaises(ValueError, group.unbind_controller, ctrl1)
Пример #24
0
 def test_Lifetime_controller(self):
     from lepton import controller, Particle, ParticleGroup
     g = ParticleGroup()
     g.new(Particle(age=0))
     g.new(Particle(age=0.8))
     g.new(Particle(age=1.0))
     g.new(Particle(age=0.75))
     lifetime = controller.Lifetime(max_age=0.75)
     g.update(0)
     lifetime(0, g)
     p = list(g)
     self.assertEqual(len(g), 2)
     self.assertFloatEqiv(p[0].age, 0.0)
     self.assertFloatEqiv(p[1].age, 0.75)
Пример #25
0
 def _make_group(self):
     from lepton import Particle, ParticleGroup
     g = ParticleGroup()
     g.new(Particle(position=(0, 1, 0), velocity=(0, -1, 0))),
     g.new(Particle(position=(0, 1, 0), velocity=(0, -1.5, 0))),
     g.new(Particle(position=(-1, -1, 1), velocity=(2, 2, 0))),
     g.new(Particle(position=(1, 1, 1), velocity=(0, 1, 0)))
     g.update(0)
     p = list(g)
     p[0].position = (0, 0, 0)
     p[1].position = (0, -0.5, 0)
     p[2].position = (1, 1, 1)
     p[3].position = (1, 2, 1)
     return g
Пример #26
0
    def test_PerParticleEmitter_time_to_live(self):
        from lepton import Particle, ParticleGroup
        from lepton.emitter import PerParticleEmitter

        source_group = ParticleGroup()
        source_group.new(object())
        source_group.new(object())
        source_group.new(object())
        source_group.new(object())
        source_group.update(0)

        emitter = PerParticleEmitter(source_group, rate=1, time_to_live=3.0)
        group = ParticleGroup(controllers=[emitter])
        count = emitter(2, group)
        self.assertEqual(count, 2 * len(source_group))
        self.assertEqual(emitter.time_to_live, 1)
        self.failUnless(emitter in group.controllers)
        count = emitter(2, group)
        # Since only one second remained before expiring
        # only one particle per should be emitted
        self.assertEqual(count, len(source_group))
        self.assertEqual(emitter.time_to_live, 0)
        self.failUnless(emitter not in group.controllers)
Пример #27
0
    def test_StaticEmitter_emit(self):
        from lepton import ParticleGroup
        from lepton.emitter import StaticEmitter

        emitter = StaticEmitter()
        group = ParticleGroup()
        self.assertEqual(len(group), 0)
        emitter.emit(10, group)
        group.update(0)
        self.assertEqual(len(group), 10)

        # Negative emit value is equivilant to zero
        emitter.emit(-10, group)
        group.update(0)
        self.assertEqual(len(group), 10)
Пример #28
0
 def particles(self):
     self.part = ParticleGroup(renderer=BillboardRenderer(texturizer2),
                               controllers=[
                                   Movement(max_velocity=self.speed,
                                            damping=0.95),
                                   Magnet(self.objective,
                                          charge=500,
                                          exponent=0),
                               ])
     self.emiter = StaticEmitter(position=self.domain,
                                 template=Particle(
                                     color=self.color,
                                     size=(self.size, self.size, 0),
                                 ))
     self.emiter.emit(1, self.part)
Пример #29
0
    def test_StaticEmitter_time_to_live(self):
        from lepton import Particle, ParticleGroup
        from lepton.emitter import StaticEmitter

        emitter = StaticEmitter(rate=1, time_to_live=3.0)
        group = ParticleGroup(controllers=[emitter])
        count = emitter(2, group)
        self.assertEqual(count, 2)
        self.assertEqual(emitter.time_to_live, 1)
        self.failUnless(emitter in group.controllers)
        count = emitter(2, group)
        # Since only one second remained before expiring
        # only one particle should be emitted
        self.assertEqual(count, 1)
        self.assertEqual(emitter.time_to_live, 0)
        self.failUnless(emitter not in group.controllers)
Пример #30
0
    def test_particle_vector_swizzle(self):
        from lepton import ParticleGroup
        group = ParticleGroup()
        newp = group.new(TestParticle())
        self.assertEqual(tuple(newp.velocity), (0, 0, 0))
        self.assertEqual(newp.velocity.x, 0)
        self.assertEqual(newp.velocity.y, 0)
        self.assertEqual(newp.velocity.z, 0)
        newp.velocity.x = 2
        newp.velocity.y = -2
        newp.velocity.z = 1
        self.assertEqual(tuple(newp.velocity), (2, -2, 1))
        self.assertEqual(newp.velocity.x, 2)
        self.assertEqual(newp.velocity.y, -2)
        self.assertEqual(newp.velocity.z, 1)
        newp.velocity = (3, 4, 5)
        self.assertEqual(tuple(newp.velocity), (3, 4, 5))
        self.assertEqual(newp.velocity.x, 3)
        self.assertEqual(newp.velocity.y, 4)
        self.assertEqual(newp.velocity.z, 5)

        self.assertEqual(tuple(newp.color), (0, 0, 0, 0))
        self.assertEqual(newp.color.r, 0)
        self.assertEqual(newp.color.g, 0)
        self.assertEqual(newp.color.b, 0)
        self.assertEqual(newp.color.a, 0)
        newp.color.r = 1
        newp.color.g = -2
        newp.color.b = 3
        newp.color.a = -1
        self.assertEqual(tuple(newp.color), (1, -2, 3, -1))
        self.assertEqual(newp.color.r, 1)
        self.assertEqual(newp.color.g, -2)
        self.assertEqual(newp.color.b, 3)
        self.assertEqual(newp.color.a, -1)
        newp.color = (5, 4, 3, 2)
        self.assertEqual(tuple(newp.color), (5, 4, 3, 2))
        self.assertEqual(newp.color.r, 5)
        self.assertEqual(newp.color.g, 4)
        self.assertEqual(newp.color.b, 3)
        self.assertEqual(newp.color.a, 2)
        newp.color = (6, 5, 4)  # alpha defaults to 1
        self.assertEqual(tuple(newp.color), (6, 5, 4, 1))
        self.assertEqual(newp.color.r, 6)
        self.assertEqual(newp.color.g, 5)
        self.assertEqual(newp.color.b, 4)
        self.assertEqual(newp.color.a, 1)