00001 00032 #ifndef LL_LLHUDICON_H 00033 #define LL_LLHUDICON_H 00034 00035 #include "llmemory.h" 00036 #include "lldarrayptr.h" 00037 00038 #include "llhudobject.h" 00039 #include "v4color.h" 00040 #include "v4coloru.h" 00041 #include "v2math.h" 00042 #include "llrect.h" 00043 #include "llframetimer.h" 00044 #include "llfontgl.h" 00045 #include <set> 00046 #include <vector> 00047 #include "lldarray.h" 00048 00049 // Renders a 2D icon billboard floating at the location specified. 00050 class LLDrawable; 00051 class LLViewerObject; 00052 00053 class LLHUDIcon : public LLHUDObject 00054 { 00055 friend class LLHUDObject; 00056 00057 public: 00058 /*virtual*/ void render(); 00059 /*virtual*/ void renderForSelect(); 00060 /*virtual*/ void markDead(); 00061 /*virtual*/ F32 getDistance() const { return mDistance; } 00062 00063 void setImage(LLViewerImage* imagep); 00064 void setScale(F32 fraction_of_fov); 00065 00066 void restartLifeTimer() { mLifeTimer.reset(); } 00067 00068 static S32 generatePickIDs(S32 start_id, S32 step_size); 00069 static LLHUDIcon* handlePick(S32 pick_id); 00070 00071 static void updateAll(); 00072 static void cleanupDeadIcons(); 00073 static S32 getNumInstances(); 00074 00075 static BOOL iconsNearby(); 00076 00077 BOOL getHidden() const { return mHidden; } 00078 void setHidden( BOOL hide ) { mHidden = hide; } 00079 00080 protected: 00081 LLHUDIcon(const U8 type); 00082 ~LLHUDIcon(); 00083 00084 void renderIcon(BOOL for_select); // common render code 00085 00086 private: 00087 LLPointer<LLViewerImage> mImagep; 00088 LLFrameTimer mAnimTimer; 00089 LLFrameTimer mLifeTimer; 00090 F32 mDistance; 00091 S32 mPickID; 00092 F32 mScale; 00093 BOOL mHidden; 00094 00095 typedef std::vector<LLPointer<LLHUDIcon> > icon_instance_t; 00096 static icon_instance_t sIconInstances; 00097 }; 00098 00099 #endif // LL_LLHUDICON_H