diff options
Diffstat (limited to 'linden/indra/newview/llvograss.h')
-rw-r--r-- | linden/indra/newview/llvograss.h | 103 |
1 files changed, 103 insertions, 0 deletions
diff --git a/linden/indra/newview/llvograss.h b/linden/indra/newview/llvograss.h new file mode 100644 index 0000000..50d5460 --- /dev/null +++ b/linden/indra/newview/llvograss.h | |||
@@ -0,0 +1,103 @@ | |||
1 | /** | ||
2 | * @file llvograss.h | ||
3 | * @brief Description of LLVOGrass class | ||
4 | * | ||
5 | * Copyright (c) 2001-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_LLVOGRASS_H | ||
29 | #define LL_LLVOGRASS_H | ||
30 | |||
31 | #include "llviewerobject.h" | ||
32 | #include "lldarray.h" | ||
33 | #include <map> | ||
34 | |||
35 | class LLSurfacePatch; | ||
36 | class LLViewerImage; | ||
37 | |||
38 | |||
39 | class LLVOGrass : public LLViewerObject | ||
40 | { | ||
41 | public: | ||
42 | LLVOGrass(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); | ||
43 | virtual ~LLVOGrass(); | ||
44 | |||
45 | // Initialize data that's only inited once per class. | ||
46 | static void initClass(); | ||
47 | static void cleanupClass(); | ||
48 | |||
49 | /*virtual*/ U32 processUpdateMessage(LLMessageSystem *mesgsys, | ||
50 | void **user_data, | ||
51 | U32 block_num, | ||
52 | const EObjectUpdateType update_type, | ||
53 | LLDataPacker *dp); | ||
54 | static void import(FILE *file, LLMessageSystem *mesgsys, const LLVector3 &pos); | ||
55 | /*virtual*/ void exportFile(FILE *file, const LLVector3 &position); | ||
56 | |||
57 | |||
58 | /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); | ||
59 | /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); | ||
60 | |||
61 | /*virtual*/ void updateTextures(LLAgent &agent); | ||
62 | /*virtual*/ BOOL updateLOD(); | ||
63 | /*virtual*/ void setPixelAreaAndAngle(LLAgent &agent); // generate accurate apparent angle and area | ||
64 | |||
65 | void plantBlades(); | ||
66 | |||
67 | /*virtual*/ BOOL isActive() const; // Whether this object needs to do an idleUpdate. | ||
68 | BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); | ||
69 | |||
70 | static S32 sMaxGrassSpecies; | ||
71 | |||
72 | struct GrassSpeciesData | ||
73 | { | ||
74 | LLUUID mTextureID; | ||
75 | |||
76 | F32 mBladeSizeX; | ||
77 | F32 mBladeSizeY; | ||
78 | }; | ||
79 | |||
80 | typedef std::map<U32, GrassSpeciesData*> SpeciesMap; | ||
81 | |||
82 | U8 mSpecies; // Species of grass | ||
83 | F32 mBladeSizeX; | ||
84 | F32 mBladeSizeY; | ||
85 | |||
86 | LLSurfacePatch *mPatch; // Stores the land patch where the grass is centered | ||
87 | |||
88 | U64 mLastPatchUpdateTime; | ||
89 | |||
90 | LLVector3 mGrassBend; // Accumulated wind (used for blowing trees) | ||
91 | LLVector3 mGrassVel; | ||
92 | LLVector3 mWind; | ||
93 | F32 mBladeWindAngle; | ||
94 | F32 mBWAOverlap; | ||
95 | |||
96 | private: | ||
97 | void updateSpecies(); | ||
98 | F32 mLastHeight; // For cheap update hack | ||
99 | S32 mNumBlades; | ||
100 | |||
101 | static SpeciesMap sSpeciesTable; | ||
102 | }; | ||
103 | #endif // LL_VO_GRASS_ | ||