diff options
author | opensim mirror account | 2010-10-19 21:50:06 -0700 |
---|---|---|
committer | opensim mirror account | 2010-10-19 21:50:06 -0700 |
commit | 436816276b9fe39c57c85525774514b6d51e8b86 (patch) | |
tree | 1f7e7d12a4569ec05187ea04e8a214e51aacf684 /OpenSim/Region/CoreModules/Avatar/ObjectCaps | |
parent | Merge branch 'master' of /var/git/opensim/ (diff) | |
parent | * This removes an ugly extraparams hack that I used and makes UploadObjectAss... (diff) | |
download | opensim-SC_OLD-436816276b9fe39c57c85525774514b6d51e8b86.zip opensim-SC_OLD-436816276b9fe39c57c85525774514b6d51e8b86.tar.gz opensim-SC_OLD-436816276b9fe39c57c85525774514b6d51e8b86.tar.bz2 opensim-SC_OLD-436816276b9fe39c57c85525774514b6d51e8b86.tar.xz |
Merge branch 'master' of /var/git/opensim/
Diffstat (limited to 'OpenSim/Region/CoreModules/Avatar/ObjectCaps')
-rw-r--r-- | OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs | 79 |
1 files changed, 62 insertions, 17 deletions
diff --git a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs index d5c6e9d..465da29 100644 --- a/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs +++ b/OpenSim/Region/CoreModules/Avatar/ObjectCaps/UploadObjectAssetModule.cs | |||
@@ -47,6 +47,7 @@ using Caps = OpenSim.Framework.Capabilities.Caps; | |||
47 | using OSD = OpenMetaverse.StructuredData.OSD; | 47 | using OSD = OpenMetaverse.StructuredData.OSD; |
48 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; | 48 | using OSDMap = OpenMetaverse.StructuredData.OSDMap; |
49 | using OpenSim.Framework.Capabilities; | 49 | using OpenSim.Framework.Capabilities; |
50 | using ExtraParamType = OpenMetaverse.ExtraParamType; | ||
50 | 51 | ||
51 | namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps | 52 | namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps |
52 | { | 53 | { |
@@ -188,25 +189,71 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps | |||
188 | rootrot = obj.Rotation; | 189 | rootrot = obj.Rotation; |
189 | 190 | ||
190 | } | 191 | } |
192 | |||
193 | |||
191 | // Combine the extraparams data into it's ugly blob again.... | 194 | // Combine the extraparams data into it's ugly blob again.... |
192 | int bytelength = 0; | 195 | //int bytelength = 0; |
193 | for (int extparams = 0; extparams < obj.ExtraParams.Length; extparams++) | 196 | //for (int extparams = 0; extparams < obj.ExtraParams.Length; extparams++) |
194 | { | 197 | //{ |
195 | bytelength += obj.ExtraParams[extparams].ExtraParamData.Length; | 198 | // bytelength += obj.ExtraParams[extparams].ExtraParamData.Length; |
196 | } | 199 | //} |
197 | byte[] extraparams = new byte[bytelength]; | 200 | //byte[] extraparams = new byte[bytelength]; |
198 | int position = 0; | 201 | //int position = 0; |
199 | 202 | ||
200 | for (int extparams = 0; extparams < obj.ExtraParams.Length; extparams++) | ||
201 | { | ||
202 | Buffer.BlockCopy(obj.ExtraParams[extparams].ExtraParamData, 0, extraparams, position, | ||
203 | obj.ExtraParams[extparams].ExtraParamData.Length); | ||
204 | 203 | ||
205 | position += obj.ExtraParams[extparams].ExtraParamData.Length; | ||
206 | } | ||
207 | 204 | ||
208 | pbs.ExtraParams = extraparams; | 205 | //for (int extparams = 0; extparams < obj.ExtraParams.Length; extparams++) |
206 | //{ | ||
207 | // Buffer.BlockCopy(obj.ExtraParams[extparams].ExtraParamData, 0, extraparams, position, | ||
208 | // obj.ExtraParams[extparams].ExtraParamData.Length); | ||
209 | // | ||
210 | // position += obj.ExtraParams[extparams].ExtraParamData.Length; | ||
211 | // } | ||
209 | 212 | ||
213 | //pbs.ExtraParams = extraparams; | ||
214 | for (int extparams = 0; extparams < obj.ExtraParams.Length; extparams++) | ||
215 | { | ||
216 | UploadObjectAssetMessage.Object.ExtraParam extraParam = obj.ExtraParams[extparams]; | ||
217 | switch ((ushort)extraParam.Type) | ||
218 | { | ||
219 | case (ushort)ExtraParamType.Sculpt: | ||
220 | pbs.SculptEntry = true; | ||
221 | pbs.SculptTexture = obj.SculptID; | ||
222 | pbs.SculptType = (byte)SculptType.Mesh; | ||
223 | |||
224 | break; | ||
225 | case (ushort)ExtraParamType.Flexible: | ||
226 | Primitive.FlexibleData flex = new Primitive.FlexibleData(extraParam.ExtraParamData, 0); | ||
227 | pbs.FlexiEntry = true; | ||
228 | pbs.FlexiDrag = flex.Drag; | ||
229 | pbs.FlexiForceX = flex.Force.X; | ||
230 | pbs.FlexiForceY = flex.Force.Y; | ||
231 | pbs.FlexiForceZ = flex.Force.Z; | ||
232 | pbs.FlexiGravity = flex.Gravity; | ||
233 | pbs.FlexiSoftness = flex.Softness; | ||
234 | pbs.FlexiTension = flex.Tension; | ||
235 | pbs.FlexiWind = flex.Wind; | ||
236 | break; | ||
237 | case (ushort)ExtraParamType.Light: | ||
238 | Primitive.LightData light = new Primitive.LightData(extraParam.ExtraParamData, 0); | ||
239 | pbs.LightColorA = light.Color.A; | ||
240 | pbs.LightColorB = light.Color.B; | ||
241 | pbs.LightColorG = light.Color.G; | ||
242 | pbs.LightColorR = light.Color.R; | ||
243 | pbs.LightCutoff = light.Cutoff; | ||
244 | pbs.LightEntry = true; | ||
245 | pbs.LightFalloff = light.Falloff; | ||
246 | pbs.LightIntensity = light.Intensity; | ||
247 | pbs.LightRadius = light.Radius; | ||
248 | break; | ||
249 | case 0x40: | ||
250 | pbs.ReadProjectionData(extraParam.ExtraParamData, 0); | ||
251 | break; | ||
252 | |||
253 | } | ||
254 | |||
255 | |||
256 | } | ||
210 | pbs.PathBegin = (ushort) obj.PathBegin; | 257 | pbs.PathBegin = (ushort) obj.PathBegin; |
211 | pbs.PathCurve = (byte) obj.PathCurve; | 258 | pbs.PathCurve = (byte) obj.PathCurve; |
212 | pbs.PathEnd = (ushort) obj.PathEnd; | 259 | pbs.PathEnd = (ushort) obj.PathEnd; |
@@ -269,9 +316,7 @@ namespace OpenSim.Region.CoreModules.Avatar.ObjectCaps | |||
269 | pbs.TextureEntry = tmp.GetBytes(); | 316 | pbs.TextureEntry = tmp.GetBytes(); |
270 | prim.Shape = pbs; | 317 | prim.Shape = pbs; |
271 | prim.Scale = obj.Scale; | 318 | prim.Scale = obj.Scale; |
272 | prim.Shape.SculptEntry = true; | 319 | |
273 | prim.Shape.SculptTexture = obj.SculptID; | ||
274 | prim.Shape.SculptType = (byte) SculptType.Mesh; | ||
275 | 320 | ||
276 | SceneObjectGroup grp = new SceneObjectGroup(); | 321 | SceneObjectGroup grp = new SceneObjectGroup(); |
277 | 322 | ||