aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/linden/indra/newview/lllocalanimationobject.cpp
diff options
context:
space:
mode:
Diffstat (limited to 'linden/indra/newview/lllocalanimationobject.cpp')
-rw-r--r--linden/indra/newview/lllocalanimationobject.cpp298
1 files changed, 0 insertions, 298 deletions
diff --git a/linden/indra/newview/lllocalanimationobject.cpp b/linden/indra/newview/lllocalanimationobject.cpp
deleted file mode 100644
index 117736b..0000000
--- a/linden/indra/newview/lllocalanimationobject.cpp
+++ /dev/null
@@ -1,298 +0,0 @@
1/**
2 * @file lllocalanimationobject.cpp
3 * @brief LLHUDLocalAnimationObject class implementation
4 *
5 * $LicenseInfo:firstyear=2006&license=viewergpl$
6 *
7 * Copyright (c) 2006-2008, Linden Research, Inc.
8 *
9 * Second Life Viewer Source Code
10 * The source code in this file ("Source Code") is provided by Linden Lab
11 * to you under the terms of the GNU General Public License, version 2.0
12 * ("GPL"), unless you have obtained a separate licensing agreement
13 * ("Other License"), formally executed by you and Linden Lab. Terms of
14 * the GPL can be found in doc/GPL-license.txt in this distribution, or
15 * online at http://secondlifegrid.net/programs/open_source/licensing/gplv2
16 *
17 * There are special exceptions to the terms and conditions of the GPL as
18 * it is applied to this Source Code. View the full text of the exception
19 * in the file doc/FLOSS-exception.txt in this software distribution, or
20 * online at http://secondlifegrid.net/programs/open_source/licensing/flossexception
21 *
22 * By copying, modifying or distributing this software, you acknowledge
23 * that you have read and understood your obligations described above,
24 * and agree to abide by those obligations.
25 *
26 * ALL LINDEN LAB SOURCE CODE IS PROVIDED "AS IS." LINDEN LAB MAKES NO
27 * WARRANTIES, EXPRESS, IMPLIED OR OTHERWISE, REGARDING ITS ACCURACY,
28 * COMPLETENESS OR PERFORMANCE.
29 * $/LicenseInfo$
30 */
31
32#include "llviewerprecompiledheaders.h"
33
34#include "lllocalanimationobject.h"
35#include "llglheaders.h"
36#include "llsphere.h"
37#include "llrand.h"
38#include "llviewerobject.h"
39
40const F32 OPACITY = 1.0f;
41const int _X_ = 0;
42const int _Y_ = 1;
43const int _Z_ = 2;
44const F32 BODY_RADIUS = 0.2f;
45const F32 HEAD_RADIUS = 0.1f;
46const F32 ONE_HALF = 0.5f;
47
48/*
49//-----------------------------------------------
50// constructor
51//-----------------------------------------------
52LLHUDLocalAnimationObject::LLHUDLocalAnimationObject()
53: LLHUDObject( LL_HUD_LOCAL_ANIMATION_OBJECT )// cal the base class and pass this in, K?
54{
55 mParentObject = NULL;
56
57 F32 windSensitivity = 0.04f;
58
59 //----------------------------------------------
60 // trunk
61 //----------------------------------------------
62 LLFlexibleObjectAttributes trunkAttributes;
63 trunkAttributes.mAnchorPositionOffset.setVec( 0.0f, 0.0f, -0.2f );
64 trunkAttributes.mAnchorDirection.setVec( 0.0f, 0.0f, 1.0f );
65 trunkAttributes.mColor = LLColor4( 0.4f, 0.3f, 0.2f, 1.0f );
66 trunkAttributes.mAnchorDirection.normVec();
67 trunkAttributes.mAnchorRadius = 0.3f;
68 trunkAttributes.mNumSections = 3;
69 trunkAttributes.mGravity = 1.2f;
70 trunkAttributes.mLength = 9.0f;
71 trunkAttributes.mTension = 10.0f;
72 trunkAttributes.mEndRadius = 0.2f;
73 trunkAttributes.mTextureFileName = "JVTestTreeTrunk.tga";
74 trunkAttributes.mRenderStyle = "tube";
75
76 mTrunk.setAttributes( trunkAttributes );
77
78
79
80 //---------------------------------------------
81 // frond 1
82 //---------------------------------------------
83 LLFlexibleObjectAttributes frond1Attributes;
84
85 frond1Attributes.mAnchorPositionOffset.setVec( 0.0f, 0.0f, 0.0f );
86 frond1Attributes.mAnchorDirection.setVec( 1.0f, 0.0f, 1.0f );
87 frond1Attributes.mAnchorDirection.normVec();
88 frond1Attributes.mColor = LLColor4( 0.15f, 0.25f, 0.0f, 1.0f );
89 frond1Attributes.mAnchorRadius = 0.5f;
90 frond1Attributes.mTension = 2.0f;
91 frond1Attributes.mNumSections = 2;
92 frond1Attributes.mGravity = 2.0f;
93 frond1Attributes.mLength = 5.0f;
94 frond1Attributes.mEndRadius = 0.0f;
95 frond1Attributes.mTextureFileName = "JVTestPalmFrond.tga";
96 frond1Attributes.mRenderStyle = "billboard_tube";
97 frond1Attributes.mWindSensitivity = windSensitivity;
98
99 mFrond1.setAttributes( frond1Attributes );
100
101 //---------------------------------------------
102 // frond 2
103 //---------------------------------------------
104 LLFlexibleObjectAttributes frond2Attributes;
105
106 frond2Attributes.mAnchorPositionOffset.setVec( 0.0f, 0.0f, 0.0f );
107 frond2Attributes.mAnchorDirection.setVec( 1.0f, 0.7f, 0.7f );
108 frond2Attributes.mAnchorDirection.normVec();
109 frond2Attributes.mColor = LLColor4( 0.15f, 0.25f, 0.0f, 1.0f );
110 frond2Attributes.mAnchorRadius = 0.5f;
111 frond2Attributes.mTension = 2.0f;
112 frond2Attributes.mNumSections = 2;
113 frond2Attributes.mGravity = 2.0f;
114 frond2Attributes.mLength = 6.0f;
115 frond2Attributes.mEndRadius = 0.0f;
116 frond2Attributes.mTextureFileName = "JVTestPalmFrond.tga";
117 frond2Attributes.mRenderStyle = "billboard_tube";
118 frond2Attributes.mWindSensitivity = windSensitivity;
119
120 mFrond2.setAttributes( frond2Attributes );
121
122 //---------------------------------------------
123 // frond 3
124 //---------------------------------------------
125 LLFlexibleObjectAttributes frond3Attributes;
126
127 frond3Attributes.mAnchorPositionOffset.setVec( 0.0f, 0.0f, 0.0f );
128 frond3Attributes.mAnchorDirection.setVec( 1.0f, 0.7f, -0.7f );
129 frond3Attributes.mAnchorDirection.normVec();
130 frond3Attributes.mColor = LLColor4( 0.15f, 0.25f, 0.0f, 1.0f );
131 frond3Attributes.mAnchorRadius = 0.3f;
132 frond3Attributes.mTension = 2.0f;
133 frond3Attributes.mNumSections = 2;
134 frond3Attributes.mGravity = 2.0f;
135 frond3Attributes.mLength = 6.0f;
136 frond3Attributes.mEndRadius = 0.0f;
137 frond3Attributes.mTextureFileName = "JVTestPalmFrond.tga";
138 frond3Attributes.mRenderStyle = "billboard_tube";
139 frond3Attributes.mWindSensitivity = windSensitivity;
140
141 mFrond3.setAttributes( frond3Attributes );
142
143
144 //---------------------------------------------
145 // frond 4
146 //---------------------------------------------
147 LLFlexibleObjectAttributes frond4Attributes;
148
149 frond4Attributes.mAnchorPositionOffset.setVec( 0.0f, 0.0f, 0.0f );
150 frond4Attributes.mAnchorDirection.setVec( 1.0f, -0.8f, 0.3f );
151 frond4Attributes.mAnchorDirection.normVec();
152 frond4Attributes.mColor = LLColor4( 0.15f, 0.25f, 0.0f, 1.0f );
153 frond4Attributes.mAnchorRadius = 0.5f;
154 frond4Attributes.mTension = 2.0f;
155 frond4Attributes.mNumSections = 2;
156 frond4Attributes.mGravity = 2.0f;
157 frond4Attributes.mLength = 6.0f;
158 frond4Attributes.mEndRadius = 0.0f;
159 frond4Attributes.mTextureFileName = "JVTestPalmFrond.tga";
160 frond4Attributes.mRenderStyle = "billboard_tube";
161 frond4Attributes.mWindSensitivity = windSensitivity;
162
163
164 mFrond4.setAttributes( frond4Attributes );
165
166
167 //---------------------------------------------
168 // frond 5
169 //---------------------------------------------
170 LLFlexibleObjectAttributes frond5Attributes;
171
172 frond5Attributes.mAnchorPositionOffset.setVec( 0.0f, 0.0f, 0.0f );
173 frond5Attributes.mAnchorDirection.setVec( 1.0f, -0.8f, -0.3f );
174 frond5Attributes.mAnchorDirection.normVec();
175 frond5Attributes.mColor = LLColor4( 0.15f, 0.25f, 0.0f, 1.0f );
176 frond5Attributes.mAnchorRadius = 0.5f;
177 frond5Attributes.mTension = 2.0f;
178 frond5Attributes.mNumSections = 2;
179 frond5Attributes.mGravity = 2.0f;
180 frond5Attributes.mLength = 5.0f;
181 frond5Attributes.mEndRadius = 0.0f;
182 frond5Attributes.mTextureFileName = "JVTestPalmFrond.tga";
183 frond5Attributes.mRenderStyle = "billboard_tube";
184 frond5Attributes.mWindSensitivity = windSensitivity;
185
186 mFrond5.setAttributes( frond5Attributes );
187
188}//------------------------------------------------------------------------------
189
190
191
192//---------------------------------------------------------------------------------
193void LLHUDLocalAnimationObject::update()
194{
195 if ( ! mParentObject )
196 {
197 return;
198 }
199
200 //--------------------------------------------------------------------------------------------------
201 // now, setting the trunk position and orientation, and updating it...
202 //--------------------------------------------------------------------------------------------------
203 mTrunk.setParentPositionAndRotationDirectly( mParentObject->getRenderPosition(), mParentObject->getRenderRotation() );
204 mTrunk.update();
205
206
207 //--------------------------------------------------------------------------------------------------
208 // now, setting the frond positions and orientations, and updating them...
209 //--------------------------------------------------------------------------------------------------
210 mFrond1.setParentPositionAndRotationDirectly( mTrunk.getEndPosition(), mTrunk.getEndRotation() );
211 mFrond2.setParentPositionAndRotationDirectly( mTrunk.getEndPosition(), mTrunk.getEndRotation() );
212 mFrond3.setParentPositionAndRotationDirectly( mTrunk.getEndPosition(), mTrunk.getEndRotation() );
213 mFrond4.setParentPositionAndRotationDirectly( mTrunk.getEndPosition(), mTrunk.getEndRotation() );
214 mFrond5.setParentPositionAndRotationDirectly( mTrunk.getEndPosition(), mTrunk.getEndRotation() );
215
216 mFrond1.update();
217 mFrond2.update();
218 mFrond3.update();
219 mFrond4.update();
220 mFrond5.update();
221
222}//------------------------------------------------------------------
223
224
225
226
227
228
229
230//------------------------------------------------------------------
231void LLHUDLocalAnimationObject::render()
232{
233 mTrunk.render();
234
235 mFrond1.render();
236 mFrond2.render();
237 mFrond3.render();
238 mFrond4.render();
239 mFrond5.render();
240
241}//------------------------------------------------------------------
242
243
244
245
246
247//------------------------------------------------------------------
248void LLHUDLocalAnimationObject::setAttributes( LLLocalAnimationObjectAttributes a )
249{
250 //mAttributes = a; // ???? // how do I do this?
251
252 //mAttributes.mAnchorPositionOffset = a.mAnchorPositionOffset;
253 //mAttributes.mAnchorDirection = a.mAnchorDirection;
254 //mAttributes.mAnchorRadius = a.mAnchorRadius;
255 //mAttributes.mNumSections = a.mNumSections;
256 //mAttributes.mLength = a.mLength;
257 //mAttributes.mGravity = a.mGravity;
258 //mAttributes.mAirFriction = a.mAirFriction;
259 //mAttributes.mTension = a.mTension;
260 //mAttributes.mRadiusChange = a.mRadiusChange;
261
262}//------------------------------------------------------------------
263
264
265
266//------------------------------------------------------------------
267void LLHUDLocalAnimationObject::setParentObject( LLViewerObject * p )
268{
269 printf( "Setting parent of localAnimationObject controls %x to object %x \n", this, p );
270 mParentObject = p;
271
272}//------------------------------------------------------------------
273
274
275//------------------------------------------------------------------
276LLViewerObject * LLHUDLocalAnimationObject::getParentObject()
277{
278 return mParentObject;
279
280}//------------------------------------------------------------------
281
282
283
284//------------------------------------------------------------------
285void LLHUDLocalAnimationObject::markAsDead()
286{
287 mDead = TRUE;
288 mParentObject = NULL;
289
290}//------------------------------------------------------------------
291
292*/
293
294
295
296
297
298