diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2023-09-28 11:49:49 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2023-09-28 11:49:49 -0400 |
commit | 2f38ead5ce7ff8ac8eeb77d84483f383b26c50e2 (patch) | |
tree | 991c351e8bc6e91b082a07ff669ee9f01dc77322 /indra/newview/llluamanager.cpp | |
parent | c4f2be4b5479d9436edb13e56a1337502b10ff66 (diff) | |
parent | 1564146fe801d9827cf21440058060a4a1c2cc63 (diff) |
DRTVWR-589: Merge remote branch 'DRTVWR-589' into DRTVWR-589
Diffstat (limited to 'indra/newview/llluamanager.cpp')
-rw-r--r-- | indra/newview/llluamanager.cpp | 23 |
1 files changed, 23 insertions, 0 deletions
diff --git a/indra/newview/llluamanager.cpp b/indra/newview/llluamanager.cpp index 7d54f6bf8f..a105eebf67 100644 --- a/indra/newview/llluamanager.cpp +++ b/indra/newview/llluamanager.cpp @@ -49,6 +49,7 @@ #include "llanimationstates.h" #include "llinventoryfunctions.h" #include "stringize.h" +#include "lltoolplacer.h" #include <boost/algorithm/string/replace.hpp> @@ -590,6 +591,28 @@ lua_function(add_branch) return 0; } +// rez_prim({x, y}, prim_type) +// avatar is the reference point +lua_function(rez_prim) +{ + lua_rawgeti(L, 1, 1); + F32 x = lua_tonumber(L, -1); + lua_pop(L, 1); + lua_rawgeti(L, 1, 2); + F32 y = lua_tonumber(L, -1); + lua_pop(L, 1); + + S32 type(lua_tonumber(L, 2)); // primitive shapes 1-8 + + LLVector3 obj_pos = gAgent.getPositionAgent() + LLVector3(x, y, -0.5); + bool res = LLToolPlacer::rezNewObject(type, NULL, 0, TRUE, gAgent.getPositionAgent(), obj_pos, gAgent.getRegion(), 0); + + LL_INFOS() << "Rezing a prim: type " << LLPrimitive::pCodeToString(type) << ", coordinates: " << obj_pos << " Success: " << res << LL_ENDL; + + lua_pop(L, lua_gettop(L)); + return 0; +} + lua_function(run_ui_command) { int top = lua_gettop(L); |