diff options
author | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
---|---|---|
committer | Jacek Antonelli | 2008-08-15 23:44:46 -0500 |
commit | 38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch) | |
tree | adca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/lltracker.h | |
parent | README.txt (diff) | |
download | meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.zip meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.gz meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.bz2 meta-impy-38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4.tar.xz |
Second Life viewer sources 1.13.2.12
Diffstat (limited to 'linden/indra/newview/lltracker.h')
-rw-r--r-- | linden/indra/newview/lltracker.h | 154 |
1 files changed, 154 insertions, 0 deletions
diff --git a/linden/indra/newview/lltracker.h b/linden/indra/newview/lltracker.h new file mode 100644 index 0000000..5d11f21 --- /dev/null +++ b/linden/indra/newview/lltracker.h | |||
@@ -0,0 +1,154 @@ | |||
1 | /** | ||
2 | * @file lltracker.h | ||
3 | * @brief Container for objects user is tracking. | ||
4 | * | ||
5 | * Copyright (c) 2003-2007, Linden Research, Inc. | ||
6 | * | ||
7 | * The source code in this file ("Source Code") is provided by Linden Lab | ||
8 | * to you under the terms of the GNU General Public License, version 2.0 | ||
9 | * ("GPL"), unless you have obtained a separate licensing agreement | ||
10 | * ("Other License"), formally executed by you and Linden Lab. Terms of | ||
11 | * the GPL can be found in doc/GPL-license.txt in this distribution, or | ||
12 | * online at http://secondlife.com/developers/opensource/gplv2 | ||
13 | * | ||
14 | * There are special exceptions to the terms and conditions of the GPL as | ||
15 | * it is applied to this Source Code. View the full text of the exception | ||
16 | * in the file doc/FLOSS-exception.txt in this software distribution, or | ||
17 | * online at http://secondlife.com/developers/opensource/flossexception | ||
18 | * | ||
19 | * By copying, modifying or distributing this software, you acknowledge | ||
20 | * that you have read and understood your obligations described above, | ||
21 | * and agree to abide by those obligations. | ||
22 | * | ||
23 | * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO | ||
24 | * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY, | ||
25 | * COMPLETENESS OR PERFORMANCE. | ||
26 | */ | ||
27 | |||
28 | // A singleton class for tracking stuff. | ||
29 | // | ||
30 | // TODO -- LLAvatarTracker functionality should probably be moved | ||
31 | // to the LLTracker class. | ||
32 | |||
33 | |||
34 | #ifndef LL_LLTRACKER_H | ||
35 | #define LL_LLTRACKER_H | ||
36 | |||
37 | #include "lldarray.h" | ||
38 | #include "llmemory.h" | ||
39 | #include "llstring.h" | ||
40 | #include "lluuid.h" | ||
41 | #include "v3dmath.h" | ||
42 | |||
43 | class LLHUDText; | ||
44 | |||
45 | |||
46 | class LLTracker | ||
47 | { | ||
48 | public: | ||
49 | enum ETrackingStatus | ||
50 | { | ||
51 | TRACKING_NOTHING = 0, | ||
52 | TRACKING_AVATAR = 1, | ||
53 | TRACKING_LANDMARK = 2, | ||
54 | TRACKING_LOCATION = 3, | ||
55 | }; | ||
56 | |||
57 | enum ETrackingLocationType | ||
58 | { | ||
59 | LOCATION_NOTHING, | ||
60 | LOCATION_EVENT, | ||
61 | LOCATION_ITEM, | ||
62 | }; | ||
63 | |||
64 | static LLTracker* instance() | ||
65 | { | ||
66 | if (!sTrackerp) | ||
67 | { | ||
68 | sTrackerp = new LLTracker(); | ||
69 | } | ||
70 | return sTrackerp; | ||
71 | } | ||
72 | |||
73 | static void cleanupInstance() { delete sTrackerp; sTrackerp = NULL; } | ||
74 | |||
75 | //static void drawTrackerArrow(); | ||
76 | // these are static so that they can be used a callbacks | ||
77 | static ETrackingStatus getTrackingStatus() { return instance()->mTrackingStatus; } | ||
78 | static ETrackingLocationType getTrackedLocationType() { return instance()->mTrackingLocationType; } | ||
79 | static BOOL isTracking(void*) { return (BOOL) instance()->mTrackingStatus; } | ||
80 | static void stopTracking(void*); | ||
81 | |||
82 | static const LLUUID& getTrackedLandmarkAssetID() { return instance()->mTrackedLandmarkAssetID; } | ||
83 | static const LLUUID& getTrackedLandmarkItemID() { return instance()->mTrackedLandmarkItemID; } | ||
84 | |||
85 | static void trackAvatar( const LLUUID& avatar_id, const LLString& name ); | ||
86 | static void trackLandmark( const LLUUID& landmark_asset_id, const LLUUID& landmark_item_id , const LLString& name); | ||
87 | static void trackLocation(const LLVector3d& pos, const LLString& full_name, const LLString& tooltip, ETrackingLocationType location_type = LOCATION_NOTHING); | ||
88 | |||
89 | // returns global pos of tracked thing | ||
90 | static LLVector3d getTrackedPositionGlobal(); | ||
91 | |||
92 | static BOOL hasLandmarkPosition(); | ||
93 | static const LLString& getTrackedLocationName(); | ||
94 | |||
95 | static void drawHUDArrow(); | ||
96 | |||
97 | // Draw in-world 3D tracking stuff | ||
98 | static void render3D(); | ||
99 | |||
100 | static BOOL handleMouseDown(S32 x, S32 y); | ||
101 | |||
102 | static LLTracker* sTrackerp; | ||
103 | static BOOL sCheesyBeacon; | ||
104 | |||
105 | static const LLString& getLabel() { return instance()->mLabel; } | ||
106 | static const LLString& getToolTip() { return instance()->mToolTip; } | ||
107 | protected: | ||
108 | LLTracker(); | ||
109 | ~LLTracker(); | ||
110 | |||
111 | static void renderBeacon( LLVector3d pos_global, | ||
112 | const LLColor4& color, | ||
113 | LLHUDText* hud_textp, | ||
114 | const std::string& label ); | ||
115 | |||
116 | void stopTrackingAll(BOOL clear_ui = FALSE); | ||
117 | void stopTrackingAvatar(BOOL clear_ui = FALSE); | ||
118 | void stopTrackingLocation(BOOL clear_ui = FALSE); | ||
119 | void stopTrackingLandmark(BOOL clear_ui = FALSE); | ||
120 | |||
121 | void drawMarker(const LLVector3d& pos_global, const LLColor4& color); | ||
122 | void setLandmarkVisited(); | ||
123 | void cacheLandmarkPosition(); | ||
124 | void purgeBeaconText(); | ||
125 | |||
126 | protected: | ||
127 | ETrackingStatus mTrackingStatus; | ||
128 | ETrackingLocationType mTrackingLocationType; | ||
129 | LLPointer<LLHUDText> mBeaconText; | ||
130 | S32 mHUDArrowCenterX; | ||
131 | S32 mHUDArrowCenterY; | ||
132 | |||
133 | LLVector3d mTrackedPositionGlobal; | ||
134 | |||
135 | LLString mLabel; | ||
136 | LLString mToolTip; | ||
137 | |||
138 | LLString mTrackedLandmarkName; | ||
139 | LLUUID mTrackedLandmarkAssetID; | ||
140 | LLUUID mTrackedLandmarkItemID; | ||
141 | LLDynamicArray<LLUUID> mLandmarkAssetIDList; | ||
142 | LLDynamicArray<LLUUID> mLandmarkItemIDList; | ||
143 | BOOL mHasReachedLandmark; | ||
144 | BOOL mHasLandmarkPosition; | ||
145 | BOOL mLandmarkHasBeenVisited; | ||
146 | |||
147 | LLString mTrackedLocationName; | ||
148 | BOOL mIsTrackingLocation; | ||
149 | BOOL mHasReachedLocation; | ||
150 | }; | ||
151 | |||
152 | |||
153 | #endif | ||
154 | |||