diff options
author | sfan5 <sfan5@live.de> | 2020-04-14 14:11:33 +0200 |
---|---|---|
committer | sfan5 <sfan5@live.de> | 2020-04-27 20:45:46 +0200 |
commit | 3475759d1adbd4a64c6250fd87981f783e64f69c (patch) | |
tree | 50e1a4402a2ecc83b6f11a76ff27c7b5b3ac59ad /doc | |
parent | aef59f2ad9a5a5a217ddadc05c46fd4d23cef47f (diff) | |
download | minetest-3475759d1adbd4a64c6250fd87981f783e64f69c.tar.gz minetest-3475759d1adbd4a64c6250fd87981f783e64f69c.tar.bz2 minetest-3475759d1adbd4a64c6250fd87981f783e64f69c.zip |
Expose collision information to LuaEntity on_step
Diffstat (limited to 'doc')
-rw-r--r-- | doc/lua_api.txt | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/doc/lua_api.txt b/doc/lua_api.txt index 3ca32649a..5e4e18b62 100644 --- a/doc/lua_api.txt +++ b/doc/lua_api.txt @@ -4147,6 +4147,8 @@ Utilities area_store_persistent_ids = true, -- Whether minetest.find_path is functional (5.2.0) pathfinder_works = true, + -- Whether Collision info is available to an objects' on_step (5.3.0) + object_step_has_moveresult = true, } * `minetest.has_feature(arg)`: returns `boolean, missing_features` @@ -6579,7 +6581,10 @@ Used by `minetest.register_entity`. on_activate = function(self, staticdata, dtime_s), - on_step = function(self, dtime), + on_step = function(self, dtime, moveresult), + -- Called every server step + -- dtime: Elapsed time + -- moveresult: Table with collision info (only available if physical=true) on_punch = function(self, puncher, time_from_last_punch, tool_capabilities, dir), @@ -6594,6 +6599,24 @@ Used by `minetest.register_entity`. -- for more info) by using a '_' prefix } +Collision info passed to `on_step`: + + { + touching_ground = boolean, + collides = boolean, + standing_on_object = boolean, + collisions = { + { + type = string, -- "node" or "object", + axis = string, -- "x", "y" or "z" + node_pos = vector, -- if type is "node" + old_speed = vector, + new_speed = vector, + }, + ... + } + } + ABM (ActiveBlockModifier) definition ------------------------------------ |