summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.h
diff options
context:
space:
mode:
authorLeviathan Linden <leviathan@lindenlab.com>2023-11-16 13:53:37 -0800
committerAndrew Meadows <andrew.l.meadows@gmail.com>2024-10-03 09:01:12 -0700
commited6ecca2a45e52d9be1d91107b9643b5ecdfb8bf (patch)
tree2b9d241bf5cb0520de13ee10f729d2b58278ce33 /indra/newview/llagent.h
parent13221f67c465017f44ca46aeca23b0d820935825 (diff)
avatar_motion-->GameControl translation and flycam
Diffstat (limited to 'indra/newview/llagent.h')
-rw-r--r--indra/newview/llagent.h32
1 files changed, 32 insertions, 0 deletions
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index afc34f747f..0394f9c76c 100644
--- a/indra/newview/llagent.h
+++ b/indra/newview/llagent.h
@@ -33,6 +33,8 @@
#include "llcharacter.h"
#include "llcoordframe.h" // for mFrameAgent
#include "llavatarappearancedefines.h"
+#include "llflycam.h"
+#include "llkeyboard.h"
#include "llpermissionsflags.h"
#include "llevents.h"
#include "v3dmath.h"
@@ -485,6 +487,7 @@ public:
void resetControlFlags();
bool anyControlGrabbed() const; // True iff a script has taken over a control
bool isControlGrabbed(S32 control_index) const;
+ bool isUsingFlycam() const { return mUsingFlycam; }
// Send message to simulator to force grabbed controls to be
// released, in case of a poorly written script.
void forceReleaseControls();
@@ -492,9 +495,38 @@ public:
private:
S32 mControlsTakenCount[TOTAL_CONTROLS];
S32 mControlsTakenPassedOnCount[TOTAL_CONTROLS];
+ // mControlFlags is a bitmask of behavior instructions for compact
+ // transmission to the server. It does NOT represent "input", rather
+ // the consequences of it, which will sometimes depend on "state".
U32 mControlFlags; // Replacement for the mFooKey's
//--------------------------------------------------------------------
+ // GameControls
+ //--------------------------------------------------------------------
+public:
+ // ActionFlags are similar to, but not the same as, ControlFlags!
+ // An 'ActionFlags' bitmask stores 'simplified input' from key/button
+ // presses that are mapped to avatar/camera movement actions
+ // whereas 'mControlFlags' are a more complicated set of behavior bits
+ // computed as a function of input and state.
+ //
+ void setExternalActionFlags(U32 flags);
+ void applyExternalActionFlags();
+ void applyExternalActionFlagsForFlycam();
+
+private:
+ void updateFlycam();
+
+ U64 mLastFlycamUpdate { 0 };
+ U32 mExternalActionFlags { 0 };
+ LLFlycam mFlycam;
+ bool mToggleFly { true };
+ bool mToggleSit { true };
+ bool mToggleRun { true };
+ bool mToggleFlycam { true };
+ bool mUsingFlycam { false };
+
+ //--------------------------------------------------------------------
// Animations
//--------------------------------------------------------------------
public: