mirror of
https://github.com/luanti-org/luanti.git
synced 2025-06-27 16:36:03 +00:00
Raycast: export exact pointing location (#6304)
* Return intersection point in node coordinates. * Clarify 'intersection_point' documentation
This commit is contained in:
parent
798724efea
commit
325bf68041
9 changed files with 63 additions and 17 deletions
|
@ -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);
|
||||
}
|
||||
|
||||
|
|
|
@ -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);
|
||||
|
||||
};
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue