diff options
Diffstat (limited to '')
-rw-r--r-- | linden/indra/newview/llvovolume.h | 46 |
1 files changed, 29 insertions, 17 deletions
diff --git a/linden/indra/newview/llvovolume.h b/linden/indra/newview/llvovolume.h index 2c12f12..9fb8ca4 100644 --- a/linden/indra/newview/llvovolume.h +++ b/linden/indra/newview/llvovolume.h | |||
@@ -29,6 +29,7 @@ | |||
29 | #define LL_LLVOVOLUME_H | 29 | #define LL_LLVOVOLUME_H |
30 | 30 | ||
31 | #include "llviewerobject.h" | 31 | #include "llviewerobject.h" |
32 | #include "llspatialpartition.h" | ||
32 | #include "llviewerimage.h" | 33 | #include "llviewerimage.h" |
33 | #include "llframetimer.h" | 34 | #include "llframetimer.h" |
34 | #include "llapr.h" | 35 | #include "llapr.h" |
@@ -60,7 +61,8 @@ public: | |||
60 | virtual bool isVolumeGlobal() const = 0; // Are we in global space? | 61 | virtual bool isVolumeGlobal() const = 0; // Are we in global space? |
61 | virtual bool isActive() const = 0; // Is this object currently active? | 62 | virtual bool isActive() const = 0; // Is this object currently active? |
62 | virtual const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const = 0; | 63 | virtual const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const = 0; |
63 | virtual void updateRelativeXform(BOOL global_volume = FALSE) = 0; | 64 | virtual void updateRelativeXform() = 0; |
65 | virtual U32 getID() const = 0; | ||
64 | }; | 66 | }; |
65 | 67 | ||
66 | // Class which embodies all Volume objects (with pcode LL_PCODE_VOLUME) | 68 | // Class which embodies all Volume objects (with pcode LL_PCODE_VOLUME) |
@@ -69,18 +71,26 @@ class LLVOVolume : public LLViewerObject | |||
69 | public: | 71 | public: |
70 | static void initClass(); | 72 | static void initClass(); |
71 | static void preUpdateGeom(); | 73 | static void preUpdateGeom(); |
72 | static F32 getTextureVirtualSize(const LLFace* face); | ||
73 | |||
74 | BOOL mWereAllTEsSame; | ||
75 | 74 | ||
75 | enum | ||
76 | { | ||
77 | VERTEX_DATA_MASK = (1 << LLVertexBuffer::TYPE_VERTEX) | | ||
78 | (1 << LLVertexBuffer::TYPE_NORMAL) | | ||
79 | (1 << LLVertexBuffer::TYPE_TEXCOORD) | | ||
80 | (1 << LLVertexBuffer::TYPE_TEXCOORD2) | | ||
81 | (1 << LLVertexBuffer::TYPE_COLOR) | ||
82 | } | ||
83 | eVertexDataMask; | ||
84 | |||
76 | public: | 85 | public: |
77 | LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); | 86 | LLVOVolume(const LLUUID &id, const LLPCode pcode, LLViewerRegion *regionp); |
78 | virtual ~LLVOVolume(); | 87 | virtual ~LLVOVolume(); |
79 | 88 | ||
80 | /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); | 89 | /*virtual*/ LLDrawable* createDrawable(LLPipeline *pipeline); |
81 | 90 | ||
82 | void deleteFaces(LLVOVolume* childp); | 91 | void deleteFaces(); |
83 | 92 | ||
93 | void animateTextures(); | ||
84 | /*virtual*/ BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); | 94 | /*virtual*/ BOOL idleUpdate(LLAgent &agent, LLWorld &world, const F64 &time); |
85 | 95 | ||
86 | /*virtual*/ BOOL isActive() const; | 96 | /*virtual*/ BOOL isActive() const; |
@@ -89,8 +99,7 @@ public: | |||
89 | /*virtual*/ BOOL isHUDAttachment() const; | 99 | /*virtual*/ BOOL isHUDAttachment() const; |
90 | 100 | ||
91 | void generateSilhouette(LLSelectNode* nodep, const LLVector3& view_point); | 101 | void generateSilhouette(LLSelectNode* nodep, const LLVector3& view_point); |
92 | 102 | /*virtual*/ void setParent(LLViewerObject* parent); | |
93 | BOOL getAllTEsSame() const { return mAllTEsSame; } | ||
94 | F32 getIndividualRadius() { return mRadius; } | 103 | F32 getIndividualRadius() { return mRadius; } |
95 | S32 getLOD() const { return mLOD; } | 104 | S32 getLOD() const { return mLOD; } |
96 | const LLVector3 getPivotPositionAgent() const; | 105 | const LLVector3 getPivotPositionAgent() const; |
@@ -105,6 +114,7 @@ public: | |||
105 | 114 | ||
106 | 115 | ||
107 | BOOL getVolumeChanged() const { return mVolumeChanged; } | 116 | BOOL getVolumeChanged() const { return mVolumeChanged; } |
117 | F32 getTextureVirtualSize(LLFace* face); | ||
108 | /*virtual*/ F32 getRadius() const { return mVObjRadius; }; | 118 | /*virtual*/ F32 getRadius() const { return mVObjRadius; }; |
109 | const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const; | 119 | const LLMatrix4& getWorldMatrix(LLXformMatrix* xform) const; |
110 | 120 | ||
@@ -120,6 +130,7 @@ public: | |||
120 | U32 block_num, const EObjectUpdateType update_type, | 130 | U32 block_num, const EObjectUpdateType update_type, |
121 | LLDataPacker *dp); | 131 | LLDataPacker *dp); |
122 | 132 | ||
133 | /*virtual*/ void setSelected(BOOL sel); | ||
123 | /*virtual*/ BOOL setDrawableParent(LLDrawable* parentp); | 134 | /*virtual*/ BOOL setDrawableParent(LLDrawable* parentp); |
124 | 135 | ||
125 | /*virtual*/ void setScale(const LLVector3 &scale, BOOL damped); | 136 | /*virtual*/ void setScale(const LLVector3 &scale, BOOL damped); |
@@ -140,17 +151,19 @@ public: | |||
140 | void setTexture(const S32 face); | 151 | void setTexture(const S32 face); |
141 | 152 | ||
142 | /*virtual*/ BOOL setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false); | 153 | /*virtual*/ BOOL setVolume(const LLVolumeParams &volume_params, const S32 detail, bool unique_volume = false); |
143 | void updateRelativeXform(BOOL global_volume = FALSE); | 154 | void updateRelativeXform(); |
144 | /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); | 155 | /*virtual*/ BOOL updateGeometry(LLDrawable *drawable); |
156 | /*virtual*/ void updateFaceSize(S32 idx); | ||
145 | /*virtual*/ BOOL updateLOD(); | 157 | /*virtual*/ BOOL updateLOD(); |
146 | void updateRadius(); | 158 | void updateRadius(); |
147 | /*virtual*/ void updateTextures(LLAgent &agent); | 159 | /*virtual*/ void updateTextures(LLAgent &agent); |
148 | void updateTextures(S32 lod); | 160 | void updateTextures(); |
149 | 161 | ||
150 | void updateFaceFlags(); | 162 | void updateFaceFlags(); |
151 | void regenFaces(); | 163 | void regenFaces(); |
152 | BOOL genTriangles(BOOL force_global); | 164 | BOOL genBBoxes(BOOL force_global); |
153 | virtual void updateSpatialExtents(LLVector3& min, LLVector3& max); | 165 | virtual void updateSpatialExtents(LLVector3& min, LLVector3& max); |
166 | virtual F32 getBinRadius(); | ||
154 | virtual void writeCAL3D(apr_file_t* fp, | 167 | virtual void writeCAL3D(apr_file_t* fp, |
155 | std::string& path, | 168 | std::string& path, |
156 | std::string& file_base, | 169 | std::string& file_base, |
@@ -161,6 +174,9 @@ public: | |||
161 | S32& texture_index, | 174 | S32& texture_index, |
162 | std::multimap<LLUUID, LLMaterialExportInfo*>& material_map); | 175 | std::multimap<LLUUID, LLMaterialExportInfo*>& material_map); |
163 | 176 | ||
177 | |||
178 | virtual U32 getPartitionType() const; | ||
179 | |||
164 | // For Lights | 180 | // For Lights |
165 | void setIsLight(BOOL is_light); | 181 | void setIsLight(BOOL is_light); |
166 | void setLightColor(const LLColor3& color); | 182 | void setLightColor(const LLColor3& color); |
@@ -178,6 +194,7 @@ public: | |||
178 | F32 getLightDistance(const LLVector3& pos) const; // returns < 0 if inside radius | 194 | F32 getLightDistance(const LLVector3& pos) const; // returns < 0 if inside radius |
179 | 195 | ||
180 | // Flexible Objects | 196 | // Flexible Objects |
197 | U32 getVolumeInterfaceID() const; | ||
181 | virtual BOOL isFlexible() const; | 198 | virtual BOOL isFlexible() const; |
182 | BOOL isVolumeGlobal() const; | 199 | BOOL isVolumeGlobal() const; |
183 | BOOL canBeFlexible() const; | 200 | BOOL canBeFlexible() const; |
@@ -188,24 +205,21 @@ public: | |||
188 | BOOL updateLighting(BOOL do_lighting); | 205 | BOOL updateLighting(BOOL do_lighting); |
189 | 206 | ||
190 | protected: | 207 | protected: |
191 | F32 computeLODProfilePathComplexityBias(); | ||
192 | S32 computeLODDetail(F32 distance, F32 radius); | 208 | S32 computeLODDetail(F32 distance, F32 radius); |
193 | BOOL calcLOD(); | 209 | BOOL calcLOD(); |
194 | void setupSingleFace(S32 face_offset); // Set up the face for combined volumes. | ||
195 | LLFace* addFace(S32 face_index); | 210 | LLFace* addFace(S32 face_index); |
196 | void updateTEData(); | 211 | void updateTEData(); |
197 | BOOL calcAllTEsSame(); | ||
198 | 212 | ||
199 | public: | 213 | public: |
200 | LLViewerTextureAnim *mTextureAnimp; | 214 | LLViewerTextureAnim *mTextureAnimp; |
201 | 215 | U8 mTexAnimMode; | |
202 | protected: | 216 | protected: |
203 | friend class LLDrawable; | 217 | friend class LLDrawable; |
204 | 218 | ||
205 | BOOL mAllTEsSame; // All TE's have the same pool/texture | ||
206 | BOOL mFaceMappingChanged; | 219 | BOOL mFaceMappingChanged; |
207 | BOOL mGlobalVolume; | 220 | BOOL mGlobalVolume; |
208 | BOOL mInited; | 221 | BOOL mInited; |
222 | LLFrameTimer mTextureUpdateTimer; | ||
209 | S32 mLOD; | 223 | S32 mLOD; |
210 | BOOL mLODChanged; | 224 | BOOL mLODChanged; |
211 | F32 mRadius; | 225 | F32 mRadius; |
@@ -218,8 +232,6 @@ protected: | |||
218 | // statics | 232 | // statics |
219 | public: | 233 | public: |
220 | static F32 sLODSlopDistanceFactor;// Changing this to zero, effectively disables the LOD transition slop | 234 | static F32 sLODSlopDistanceFactor;// Changing this to zero, effectively disables the LOD transition slop |
221 | static F32 sLODComplexityDistanceBias; // Changing this to zero makes all prims LOD at the same distance, | ||
222 | // regardless of complexity | ||
223 | static F32 sLODFactor; // LOD scale factor | 235 | static F32 sLODFactor; // LOD scale factor |
224 | static F32 sDistanceFactor; // LOD distance factor | 236 | static F32 sDistanceFactor; // LOD distance factor |
225 | 237 | ||