00001 00032 #ifndef LL_LLVIEWERJOINTATTACHMENT_H 00033 #define LL_LLVIEWERJOINTATTACHMENT_H 00034 00035 //----------------------------------------------------------------------------- 00036 // Header Files 00037 //----------------------------------------------------------------------------- 00038 #include "llviewerjoint.h" 00039 #include "llstring.h" 00040 #include "lluuid.h" 00041 00042 class LLDrawable; 00043 class LLViewerObject; 00044 00045 //----------------------------------------------------------------------------- 00046 // class LLViewerJointAttachment 00047 //----------------------------------------------------------------------------- 00048 class LLViewerJointAttachment : 00049 public LLViewerJoint 00050 { 00051 public: 00052 LLViewerJointAttachment(); 00053 virtual ~LLViewerJointAttachment(); 00054 00055 //virtual U32 render( F32 pixelArea ); // Returns triangle count 00056 00057 // Returns true if this object is transparent. 00058 // This is used to determine in which order to draw objects. 00059 /*virtual*/ BOOL isTransparent(); 00060 00061 // Draws the shape attached to a joint. 00062 // Called by render(). 00063 /*virtual*/ U32 drawShape( F32 pixelArea, BOOL first_pass ); 00064 00065 /*virtual*/ BOOL updateLOD(F32 pixel_area, BOOL activate); 00066 00067 // 00068 // accessors 00069 // 00070 00071 void setJoint (LLJoint* joint) { mJoint = joint; } 00072 void setPieSlice(S32 pie_slice) { mPieSlice = pie_slice; } 00073 void setVisibleInFirstPerson(BOOL visibility) { mVisibleInFirst = visibility; } 00074 BOOL getVisibleInFirstPerson() { return mVisibleInFirst; } 00075 void setGroup(S32 group) { mGroup = group; } 00076 void setOriginalPosition(LLVector3 &position); 00077 void setAttachmentVisibility(BOOL visible); 00078 void setIsHUDAttachment(BOOL is_hud) { mIsHUDAttachment = is_hud; } 00079 BOOL getIsHUDAttachment() { return mIsHUDAttachment; } 00080 00081 BOOL isAnimatable() { return FALSE; } 00082 00083 S32 getGroup() { return mGroup; } 00084 S32 getPieSlice() { return mPieSlice; } 00085 BOOL getAttachmentDirty() { return mAttachmentDirty && mAttachedObject; } 00086 LLViewerObject *getObject() { return mAttachedObject; } 00087 S32 getNumObjects() { return (mAttachedObject ? 1 : 0); } 00088 const LLUUID& getItemID() { return mItemID; } 00089 00090 // 00091 // unique methods 00092 // 00093 BOOL addObject(LLViewerObject* object); 00094 void removeObject(LLViewerObject *object); 00095 00096 void lazyAttach(); 00097 void setupDrawable(LLDrawable* drawable); 00098 void clampObjectPosition(); 00099 00100 protected: 00101 void calcLOD(); 00102 00103 protected: 00104 LLJoint* mJoint; 00105 // Backlink only; don't make this an LLPointer. 00106 LLViewerObject* mAttachedObject; 00107 BOOL mAttachmentDirty; // does attachment drawable need to be fixed up? 00108 BOOL mVisibleInFirst; 00109 LLVector3 mOriginalPos; 00110 S32 mGroup; 00111 BOOL mIsHUDAttachment; 00112 S32 mPieSlice; 00113 LLUUID mItemID; // Inventory item id of the attached item (null if not in inventory) 00114 }; 00115 00116 #endif // LL_LLVIEWERJOINTATTACHMENT_H