diff options
author | Nat Goodspeed <nat@lindenlab.com> | 2024-08-08 09:07:56 -0400 |
---|---|---|
committer | Nat Goodspeed <nat@lindenlab.com> | 2024-08-08 09:07:56 -0400 |
commit | b4fe47a5c0abac02d161640e04a9a78afb1c5987 (patch) | |
tree | adea35b7d9822ae248d22a3303843e563b974b4b /indra/newview/scripts/lua/test_flycam.lua | |
parent | cdc4f5dbd69526906724dc298594906826f6b8b0 (diff) |
Ensure that the flycam stays near moving avatar.
Diffstat (limited to 'indra/newview/scripts/lua/test_flycam.lua')
-rw-r--r-- | indra/newview/scripts/lua/test_flycam.lua | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/indra/newview/scripts/lua/test_flycam.lua b/indra/newview/scripts/lua/test_flycam.lua index 4fb5608b33..05c3c37b93 100644 --- a/indra/newview/scripts/lua/test_flycam.lua +++ b/indra/newview/scripts/lua/test_flycam.lua @@ -4,7 +4,6 @@ local LLAgent = require 'LLAgent' local startup = require 'startup' local timers = require 'timers' -local initial = LLAgent.getRegionPosition() local height = 2.0 -- meters local radius = 4.0 -- meters local speed = 1.0 -- meters/second along circle @@ -12,11 +11,12 @@ local start = os.clock() local stop = os.clock() + 30 -- seconds local function cameraPos(t) + local agent = LLAgent.getRegionPosition() local radians = speed * t return { - initial[1] + radius * math.cos(radians), - initial[2] + radius * math.sin(radians), - initial[3] + height + agent[1] + radius * math.cos(radians), + agent[2] + radius * math.sin(radians), + agent[3] + height } end |