Skip to content
Snippets Groups Projects
  • Auke Kok's avatar
    d499ec48
    Particles: Add option to remove particles on collision · d499ec48
    Auke Kok authored
    Adds the particle option `collision_removal = bool`
    
    Some particles are hard to use right now since they either go through
    solid blocks (without collision detection), and with collision
    detection enabled they (e.g. raindrops) would just stop dead on the
    floor and sit there until they expire, or worse, scrape along a wall
    or ceiling.
    
    We can solve the problem by adding a boolean flag that tells the
    particle to be removed if it ever collides with something. This will
    make it easier to add rain that doesn't fall through your roof or stick
    on the top of it. Or clouds and smoke that don't go through trees.
    
    Particles that collide with this flag are marked expired
    unconditionally, causing them to be treated like normal expired
    particles and cleaned up normally.
    
    Documentation is adjusted accordingly.
    
    An added bonus of this patch is that particles can potentially collide
    many times with nodes, and this reduces the amount of collisions to 1
    (max), which may end up reducing particle load on the client.
    d499ec48
    History
    Particles: Add option to remove particles on collision
    Auke Kok authored
    Adds the particle option `collision_removal = bool`
    
    Some particles are hard to use right now since they either go through
    solid blocks (without collision detection), and with collision
    detection enabled they (e.g. raindrops) would just stop dead on the
    floor and sit there until they expire, or worse, scrape along a wall
    or ceiling.
    
    We can solve the problem by adding a boolean flag that tells the
    particle to be removed if it ever collides with something. This will
    make it easier to add rain that doesn't fall through your roof or stick
    on the top of it. Or clouds and smoke that don't go through trees.
    
    Particles that collide with this flag are marked expired
    unconditionally, causing them to be treated like normal expired
    particles and cleaned up normally.
    
    Documentation is adjusted accordingly.
    
    An added bonus of this patch is that particles can potentially collide
    many times with nodes, and this reduces the amount of collisions to 1
    (max), which may end up reducing particle load on the client.