summaryrefslogtreecommitdiff
path: root/doc/lua_api.txt
diff options
context:
space:
mode:
authorAuke Kok <sofar+github@foo-projects.org>2016-05-27 21:08:23 -0700
committerkwolekr <kwolekr@minetest.net>2016-05-28 00:08:23 -0400
commitd499ec483837fa7210176ef39beba2d5a3a5a61d (patch)
tree8476d09d0c351481a7b14fc32e51b95a4e07dd3e /doc/lua_api.txt
parent62d15ac7c1fcd7214a9e45d46bbc560f998edb95 (diff)
downloadminetest-d499ec483837fa7210176ef39beba2d5a3a5a61d.tar.gz
minetest-d499ec483837fa7210176ef39beba2d5a3a5a61d.tar.bz2
minetest-d499ec483837fa7210176ef39beba2d5a3a5a61d.zip
Particles: Add option to remove particles on collision
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.
Diffstat (limited to 'doc/lua_api.txt')
-rw-r--r--doc/lua_api.txt6
1 files changed, 6 insertions, 0 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt
index 01763fd73..03f2dad32 100644
--- a/doc/lua_api.txt
+++ b/doc/lua_api.txt
@@ -3885,6 +3885,9 @@ Definition tables
size = 1,
collisiondetection = false,
-- ^ collisiondetection: if true collides with physical objects
+ collision_removal = false,
+ -- ^ collision_removal: if true then particle is removed when it collides,
+ -- ^ requires collisiondetection = true to have any effect
vertical = false,
-- ^ vertical: if true faces player using y axis only
texture = "image.png",
@@ -3914,6 +3917,9 @@ Definition tables
-- ^ minsize/maxsize, minexptime/maxexptime (expirationtime)
collisiondetection = false,
-- ^ collisiondetection: if true uses collision detection
+ collision_removal = false,
+ -- ^ collision_removal: if true then particle is removed when it collides,
+ -- ^ requires collisiondetection = true to have any effect
vertical = false,
-- ^ vertical: if true faces player using y axis only
texture = "image.png",