diff options
author | Dániel Juhász <juhdanad@gmail.com> | 2018-08-16 20:10:08 +0200 |
---|---|---|
committer | SmallJoker <SmallJoker@users.noreply.github.com> | 2018-08-16 20:10:08 +0200 |
commit | 325bf680410e8012394e5f3ba5ba947c69034899 (patch) | |
tree | 66ed6c2b0c9d7a1c915006212ecde535699e16c4 /src/script/cpp_api | |
parent | 798724efeab2d71da4f041be99de86baa3d3cdd5 (diff) | |
download | minetest-325bf680410e8012394e5f3ba5ba947c69034899.tar.gz minetest-325bf680410e8012394e5f3ba5ba947c69034899.tar.bz2 minetest-325bf680410e8012394e5f3ba5ba947c69034899.zip |
Raycast: export exact pointing location (#6304)
* Return intersection point in node coordinates.
* Clarify 'intersection_point' documentation
Diffstat (limited to 'src/script/cpp_api')
-rw-r--r-- | src/script/cpp_api/s_item.cpp | 4 | ||||
-rw-r--r-- | src/script/cpp_api/s_item.h | 6 |
2 files changed, 7 insertions, 3 deletions
diff --git a/src/script/cpp_api/s_item.cpp b/src/script/cpp_api/s_item.cpp index 94abe267b..cbdfcf1b1 100644 --- a/src/script/cpp_api/s_item.cpp +++ b/src/script/cpp_api/s_item.cpp @@ -255,10 +255,10 @@ bool ScriptApiItem::getItemCallback(const char *name, const char *callbackname, return false; } -void ScriptApiItem::pushPointedThing(const PointedThing& pointed) +void ScriptApiItem::pushPointedThing(const PointedThing &pointed, bool hitpoint) { lua_State* L = getStack(); - push_pointed_thing(L, pointed); + push_pointed_thing(L, pointed, false, hitpoint); } diff --git a/src/script/cpp_api/s_item.h b/src/script/cpp_api/s_item.h index d91b5c1d6..6c7f286a9 100644 --- a/src/script/cpp_api/s_item.h +++ b/src/script/cpp_api/s_item.h @@ -54,6 +54,10 @@ protected: friend class LuaRaycast; bool getItemCallback(const char *name, const char *callbackname, const v3s16 *p = nullptr); - void pushPointedThing(const PointedThing& pointed); + /*! + * Pushes a `pointed_thing` tabe to the stack. + * \param hitpoint If true, the exact pointing location is also pushed + */ + void pushPointedThing(const PointedThing &pointed, bool hitpoint = false); }; |