00001
00032 #ifndef LL_LLVIEWERPARTSOURCE_H
00033 #define LL_LLVIEWERPARTSOURCE_H
00034
00035 #include "llmemory.h"
00036 #include "llpartdata.h"
00037 #include "llquaternion.h"
00038 #include "v3math.h"
00039
00041
00042
00043
00044
00045
00046 class LLViewerImage;
00047 class LLViewerObject;
00048 class LLViewerPart;
00049
00050 class LLViewerPartSource : public LLRefCount
00051 {
00052 public:
00053 enum
00054 {
00055 LL_PART_SOURCE_NULL,
00056 LL_PART_SOURCE_SCRIPT,
00057 LL_PART_SOURCE_SPIRAL,
00058 LL_PART_SOURCE_BEAM,
00059 LL_PART_SOURCE_CHAT
00060 };
00061
00062 LLViewerPartSource(const U32 type);
00063
00064 virtual void update(const F32 dt);
00065
00066 virtual void setDead();
00067 BOOL isDead() const { return mIsDead; }
00068 void setSuspended( BOOL state ) { mIsSuspended = state; }
00069 BOOL isSuspended() const { return mIsSuspended; }
00070 U32 getType() const { return mType; }
00071 static void updatePart(LLViewerPart &part, const F32 dt);
00072 void setOwnerUUID(const LLUUID& owner_id) { mOwnerUUID = owner_id; }
00073 LLUUID getOwnerUUID() const { return mOwnerUUID; }
00074 U32 getID() const { return mID; }
00075 LLUUID getImageUUID() const;
00076 void setStart() ;
00077
00078 LLVector3 mPosAgent;
00079 LLVector3 mTargetPosAgent;
00080 LLVector3 mLastUpdatePosAgent;
00081 LLPointer<LLViewerObject> mSourceObjectp;
00082 U32 mID;
00083
00084 protected:
00085 U32 mType;
00086 BOOL mIsDead;
00087 BOOL mIsSuspended;
00088 F32 mLastUpdateTime;
00089 F32 mLastPartTime;
00090 LLUUID mOwnerUUID;
00091 LLPointer<LLViewerImage> mImagep;
00092
00093
00094 U32 mPartFlags;
00095 U32 mDelay ;
00096 };
00097
00098
00099
00101
00102
00103
00104
00105
00106
00107
00108
00109 class LLViewerPartSourceScript : public LLViewerPartSource
00110 {
00111 public:
00112 LLViewerPartSourceScript(LLViewerObject *source_objp);
00113 void update(const F32 dt);
00114
00115 void setDead();
00116
00117 BOOL updateFromMesg();
00118
00119
00120 static LLPointer<LLViewerPartSourceScript> unpackPSS(LLViewerObject *source_objp, LLPointer<LLViewerPartSourceScript> pssp, const S32 block_num);
00121 static LLPointer<LLViewerPartSourceScript> unpackPSS(LLViewerObject *source_objp, LLPointer<LLViewerPartSourceScript> pssp, LLDataPacker &dp);
00122 static LLPointer<LLViewerPartSourceScript> createPSS(LLViewerObject *source_objp, const LLPartSysData& particle_parameters);
00123
00124 LLViewerImage *getImage() const { return mImagep; }
00125 void setImage(LLViewerImage *imagep);
00126 LLPartSysData mPartSysData;
00127
00128 void setTargetObject(LLViewerObject *objp);
00129
00130 protected:
00131 LLQuaternion mRotation;
00132 LLPointer<LLViewerObject> mTargetObjectp;
00133 };
00134
00135
00137
00138
00139
00140
00141 class LLViewerPartSourceSpiral : public LLViewerPartSource
00142 {
00143 public:
00144 LLViewerPartSourceSpiral(const LLVector3 &pos);
00145
00146 void setDead();
00147
00148 void update(const F32 dt);
00149
00150 void setSourceObject(LLViewerObject *objp);
00151 void setColor(const LLColor4 &color);
00152
00153 static void updatePart(LLViewerPart &part, const F32 dt);
00154 LLColor4 mColor;
00155 protected:
00156 LLVector3d mLKGSourcePosGlobal;
00157 };
00158
00159
00161
00162
00163
00164
00165 class LLViewerPartSourceBeam : public LLViewerPartSource
00166 {
00167 public:
00168 LLViewerPartSourceBeam();
00169
00170 void setDead();
00171
00172 void update(const F32 dt);
00173
00174 void setSourceObject(LLViewerObject *objp);
00175 void setTargetObject(LLViewerObject *objp);
00176 void setSourcePosGlobal(const LLVector3d &pos_global);
00177 void setTargetPosGlobal(const LLVector3d &pos_global);
00178 void setColor(const LLColor4 &color);
00179
00180 static void updatePart(LLViewerPart &part, const F32 dt);
00181 LLPointer<LLViewerObject> mTargetObjectp;
00182 LLVector3d mLKGTargetPosGlobal;
00183 LLColor4 mColor;
00184 protected:
00185 ~LLViewerPartSourceBeam();
00186 };
00187
00188
00189
00191
00192
00193
00194
00195 class LLViewerPartSourceChat : public LLViewerPartSource
00196 {
00197 public:
00198 LLViewerPartSourceChat(const LLVector3 &pos);
00199
00200 void setDead();
00201
00202 void update(const F32 dt);
00203
00204 void setSourceObject(LLViewerObject *objp);
00205 void setColor(const LLColor4 &color);
00206 static void updatePart(LLViewerPart &part, const F32 dt);
00207 LLColor4 mColor;
00208 protected:
00209 LLVector3d mLKGSourcePosGlobal;
00210 };
00211
00212
00213 #endif // LL_LLVIEWERPARTSOURCE_H