summaryrefslogtreecommitdiff
path: root/indra/newview/scripts/lua/require/LLAgent.lua
diff options
context:
space:
mode:
authorMnikolenko Productengine <mnikolenko@productengine.com>2024-07-25 18:15:24 +0300
committerMnikolenko Productengine <mnikolenko@productengine.com>2024-07-25 18:15:24 +0300
commitdecc2d3aa5ba8dc583dae5396a5ae8ca738412dd (patch)
treeda133ca6dfe803f7c28cdd479e76e72a4a6da7ce /indra/newview/scripts/lua/require/LLAgent.lua
parentb5c58810412d00c4aee81ec7e651d428a18a52f2 (diff)
Lua api for Follow Camera control
Diffstat (limited to 'indra/newview/scripts/lua/require/LLAgent.lua')
-rw-r--r--indra/newview/scripts/lua/require/LLAgent.lua28
1 files changed, 28 insertions, 0 deletions
diff --git a/indra/newview/scripts/lua/require/LLAgent.lua b/indra/newview/scripts/lua/require/LLAgent.lua
new file mode 100644
index 0000000000..7c6a842555
--- /dev/null
+++ b/indra/newview/scripts/lua/require/LLAgent.lua
@@ -0,0 +1,28 @@
+local leap = require 'leap'
+local mapargs = require 'mapargs'
+
+local LLAgent = {}
+
+function LLAgent.getRegionPosition()
+ return leap.request('LLAgent', {op = 'getPosition'}).region
+end
+
+function LLAgent.getGlobalPosition()
+ return leap.request('LLAgent', {op = 'getPosition'}).global
+end
+
+function LLAgent.setCamera(...)
+ local args = mapargs('camera_pos,focus_pos,focus_offset,camera_locked,focus_locked', ...)
+ args.op = 'setCameraParams'
+ leap.send('LLAgent', args)
+end
+
+function LLAgent.setFollowCamActive(active)
+ leap.send('LLAgent', {op = 'setFollowCamActive', active = active})
+end
+
+function LLAgent.removeCamParams()
+ leap.send('LLAgent', {op = 'removeCameraParams'})
+end
+
+return LLAgent