summaryrefslogtreecommitdiff
path: root/indra/newview/llagent.h
diff options
context:
space:
mode:
Diffstat (limited to 'indra/newview/llagent.h')
-rw-r--r--indra/newview/llagent.h41
1 files changed, 36 insertions, 5 deletions
diff --git a/indra/newview/llagent.h b/indra/newview/llagent.h
index 8f892025c9..489131d974 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"
@@ -475,21 +477,50 @@ public:
void setControlFlags(U32 mask); // Performs bitwise mControlFlags |= mask
void clearControlFlags(U32 mask); // Performs bitwise mControlFlags &= ~mask
bool controlFlagsDirty() const;
- void enableControlFlagReset();
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();
- void setFlagsDirty() { mbFlagsDirty = true; }
private:
S32 mControlsTakenCount[TOTAL_CONTROLS];
S32 mControlsTakenPassedOnCount[TOTAL_CONTROLS];
- U32 mControlFlags; // Replacement for the mFooKey's
- bool mbFlagsDirty;
- bool mbFlagsNeedReset; // ! HACK ! For preventing incorrect flags sent when crossing region boundaries
+ // 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;
+
+ //--------------------------------------------------------------------
+ // GameControls
+ //--------------------------------------------------------------------
+public:
+ // ActionFlags are similar to, but not the same as, ControlFlags!
+ // An 'ActionFlags' bitmask stores 'simplified input' from key/button
+ // presses that correspond to avatar/camera movement actions
+ // whereas 'mControlFlags' are a more complicated set of behavior bits
+ // computed as a function of input and state, and are sent to the server
+ // to steer its character controller for the avatar.
+ //
+ void applyExternalActionFlags(U32 flags);
+ void updateFlycam();
+
+ void pressGameControlButton(U8 button);
+ void releaseGameControlButton(U8 button);
+ U32 getGameControlButtonsFromKeys() const { return mGameControlButtonsFromKeys; }
+
+private:
+
+ U64 mLastFlycamUpdate { 0 };
+ U32 mExternalActionFlags { 0 };
+ U32 mGameControlButtonsFromKeys { 0 };
+ LLFlycam mFlycam;
+ bool mToggleFly { true };
+ bool mToggleRun { true };
+ bool mToggleFlycam { true };
+ bool mUsingFlycam { false };
//--------------------------------------------------------------------
// Animations