Skip to content
Snippets Groups Projects
user avatar
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
Name Last commit Last update
..
cguittfont
client
gmp
json
lua
network
script
threading
unittest
util
CMakeLists.txt
activeobject.h
ban.cpp
ban.h
camera.cpp
camera.h
cavegen.cpp
cavegen.h
chat.cpp
chat.h
chat_interface.h
client.cpp
client.h
clientiface.cpp
clientiface.h
clientmap.cpp
clientmap.h
clientmedia.cpp
clientmedia.h
clientobject.cpp
clientobject.h
clientsimpleobject.h
clouds.cpp
clouds.h
cmake_config.h.in
cmake_config_githash.h.in
collision.cpp
collision.h
config.h
constants.h
content_abm.cpp
content_abm.h
content_cao.cpp
content_cao.h
content_cso.cpp
content_cso.h
content_mapblock.cpp
content_mapblock.h
content_mapnode.cpp
content_mapnode.h
content_nodemeta.cpp
content_nodemeta.h
content_sao.cpp
content_sao.h
convert_json.cpp
convert_json.h
craftdef.cpp
craftdef.h
database-dummy.cpp
database-dummy.h
database-leveldb.cpp
database-leveldb.h
database-postgresql.cpp
database-postgresql.h
database-redis.cpp
database-redis.h
database-sqlite3.cpp
database-sqlite3.h
database.cpp
database.h
daynightratio.h
debug.cpp
debug.h
defaultsettings.cpp
defaultsettings.h
drawscene.cpp
drawscene.h
dungeongen.cpp
dungeongen.h
emerge.cpp
emerge.h
environment.cpp
environment.h
event.h
event_manager.h
exceptions.h
filecache.cpp
filecache.h
filesys.cpp
filesys.h
fontengine.cpp
fontengine.h
game.cpp
game.h
gamedef.h
gameparams.h
genericobject.cpp
genericobject.h
gettext.cpp
gettext.h