aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/llviewerpartsource.h
diff options
context:
space:
mode:
authorJacek Antonelli2008-08-15 23:44:46 -0500
committerJacek Antonelli2008-08-15 23:44:46 -0500
commit38d6d37f2d982fa959e9e8a4a3f7e1ccfad7b5d4 (patch)
treeadca584755d22ca041a2dbfc35d4eca01f70b32c /linden/indra/newview/llviewerpartsource.h
parentREADME.txt (diff)
downloadmeta-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/llviewerpartsource.h')
-rw-r--r--linden/indra/newview/llviewerpartsource.h207
1 files changed, 207 insertions, 0 deletions
diff --git a/linden/indra/newview/llviewerpartsource.h b/linden/indra/newview/llviewerpartsource.h
new file mode 100644
index 0000000..66de36b
--- /dev/null
+++ b/linden/indra/newview/llviewerpartsource.h
@@ -0,0 +1,207 @@
1/**
2 * @file llviewerpartsource.h
3 * @brief LLViewerPartSource class header file
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#ifndef LL_LLVIEWERPARTSOURCE_H
29#define LL_LLVIEWERPARTSOURCE_H
30
31#include "llmemory.h"
32#include "llpartdata.h"
33#include "llquaternion.h"
34#include "v3math.h"
35
36////////////////////
37//
38// A particle source - subclassed to generate particles with different behaviors
39//
40//
41
42class LLViewerImage;
43class LLViewerObject;
44class LLViewerPart;
45
46class LLViewerPartSource : public LLRefCount
47{
48public:
49 enum
50 {
51 LL_PART_SOURCE_NULL,
52 LL_PART_SOURCE_SCRIPT,
53 LL_PART_SOURCE_SPIRAL,
54 LL_PART_SOURCE_BEAM,
55 LL_PART_SOURCE_CHAT
56 };
57
58 LLViewerPartSource(const U32 type);
59
60 virtual void update(const F32 dt); // Return FALSE if this source is dead...
61
62 virtual void setDead();
63 BOOL isDead() const { return mIsDead; }
64
65 U32 getType() const { return mType; }
66 static void updatePart(LLViewerPart &part, const F32 dt);
67 void setOwnerUUID(const LLUUID& owner_id) { mOwnerUUID = owner_id; }
68 LLUUID getOwnerUUID() const { return mOwnerUUID; }
69
70 LLVector3 mPosAgent; // Location of the particle source
71 LLVector3 mTargetPosAgent; // Location of the target position
72 LLVector3 mLastUpdatePosAgent;
73protected:
74 U32 mType;
75 BOOL mIsDead;
76 F32 mLastUpdateTime;
77 F32 mLastPartTime;
78 LLUUID mOwnerUUID;
79
80 // Particle information
81 U32 mPartFlags; // Flags for the particle
82};
83
84
85
86///////////////////////////////
87//
88// LLViewerPartSourceScript
89//
90// Particle source that handles the "generic" script-drive particle source
91// attached to objects
92//
93
94
95class LLViewerPartSourceScript : public LLViewerPartSource
96{
97public:
98 LLViewerPartSourceScript(LLViewerObject *source_objp);
99 /*virtual*/ void update(const F32 dt);
100
101 /*virtual*/ void setDead();
102
103 BOOL updateFromMesg();
104
105 // Returns a new particle source to attach to an object...
106 static LLViewerPartSourceScript *unpackPSS(LLViewerObject *source_objp, LLViewerPartSourceScript *pssp, const S32 block_num);
107 static LLViewerPartSourceScript *unpackPSS(LLViewerObject *source_objp, LLViewerPartSourceScript *pssp, LLDataPacker &dp);
108
109 LLViewerImage *getImage() const { return mImagep; }
110 void setImage(LLViewerImage *imagep);
111 LLPartSysData mPartSysData;
112
113 void setTargetObject(LLViewerObject *objp);
114
115protected:
116 LLQuaternion mRotation; // Current rotation for particle source
117 LLPointer<LLViewerImage> mImagep; // Cached image pointer of the mPartSysData UUID
118 LLPointer<LLViewerObject> mSourceObjectp; // Source object that this particle system is attached to
119 LLPointer<LLViewerObject> mTargetObjectp; // Target object for the particle source
120};
121
122
123////////////////////////////
124//
125// Particle source for spiral effect (customize avatar, mostly)
126//
127
128class LLViewerPartSourceSpiral : public LLViewerPartSource
129{
130public:
131 LLViewerPartSourceSpiral(const LLVector3 &pos);
132
133 /*virtual*/ void setDead();
134
135 /*virtual*/ void update(const F32 dt);
136
137 void setSourceObject(LLViewerObject *objp);
138 void setColor(const LLColor4 &color);
139
140 static void updatePart(LLViewerPart &part, const F32 dt);
141 LLColor4 mColor;
142protected:
143 LLPointer<LLViewerImage> mImagep;
144 LLPointer<LLViewerObject> mSourceObjectp;
145 LLVector3d mLKGSourcePosGlobal;
146};
147
148
149////////////////////////////
150//
151// Particle source for tractor(editing) beam
152//
153
154class LLViewerPartSourceBeam : public LLViewerPartSource
155{
156public:
157 LLViewerPartSourceBeam();
158 ~LLViewerPartSourceBeam();
159
160 /*virtual*/ void setDead();
161
162 /*virtual*/ void update(const F32 dt);
163
164 void setSourceObject(LLViewerObject *objp);
165 void setTargetObject(LLViewerObject *objp);
166 void setSourcePosGlobal(const LLVector3d &pos_global);
167 void setTargetPosGlobal(const LLVector3d &pos_global);
168 void setColor(const LLColor4 &color);
169
170 static void updatePart(LLViewerPart &part, const F32 dt);
171 LLPointer<LLViewerImage> mImagep;
172 LLPointer<LLViewerObject> mSourceObjectp;
173 LLPointer<LLViewerObject> mTargetObjectp;
174 LLVector3d mLKGTargetPosGlobal;
175 LLColor4 mColor;
176protected:
177};
178
179
180
181//////////////////////////
182//
183// Particle source for chat effect
184//
185
186class LLViewerPartSourceChat : public LLViewerPartSource
187{
188public:
189 LLViewerPartSourceChat(const LLVector3 &pos);
190
191 /*virtual*/ void setDead();
192
193 /*virtual*/ void update(const F32 dt);
194
195 void setSourceObject(LLViewerObject *objp);
196 void setColor(const LLColor4 &color);
197
198 static void updatePart(LLViewerPart &part, const F32 dt);
199 LLColor4 mColor;
200protected:
201 LLPointer<LLViewerImage> mImagep;
202 LLPointer<LLViewerObject> mSourceObjectp;
203 LLVector3d mLKGSourcePosGlobal;
204};
205
206
207#endif // LL_LLVIEWERPARTSOURCE_H