aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authordahlia2010-10-14 20:25:31 -0700
committerdahlia2010-10-14 20:25:31 -0700
commitbcdd03c1cfcfab72d6ee4199bd1232ff3a748d6e (patch)
tree69490e4ac18a743b862ea6d031a1c8fd9a66ae1d
parentlibomv update to support headerless llsd binary deserialization needed for me... (diff)
downloadopensim-SC_OLD-bcdd03c1cfcfab72d6ee4199bd1232ff3a748d6e.zip
opensim-SC_OLD-bcdd03c1cfcfab72d6ee4199bd1232ff3a748d6e.tar.gz
opensim-SC_OLD-bcdd03c1cfcfab72d6ee4199bd1232ff3a748d6e.tar.bz2
opensim-SC_OLD-bcdd03c1cfcfab72d6ee4199bd1232ff3a748d6e.tar.xz
more work in progress on mesh physics - still non-functional
-rw-r--r--OpenSim/Region/Physics/Meshing/Meshmerizer.cs69
-rw-r--r--bin/OpenMetaverse.StructuredData.XML28
-rw-r--r--prebuild.xml2
3 files changed, 75 insertions, 24 deletions
diff --git a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
index e1203ea..df44be3 100644
--- a/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
+++ b/OpenSim/Region/Physics/Meshing/Meshmerizer.cs
@@ -30,9 +30,11 @@ using System;
30using System.Collections.Generic; 30using System.Collections.Generic;
31using OpenSim.Framework; 31using OpenSim.Framework;
32using OpenSim.Region.Physics.Manager; 32using OpenSim.Region.Physics.Manager;
33using OpenMetaverse; 33using OpenMetaverse;
34using OpenMetaverse.StructuredData;
34using System.Drawing; 35using System.Drawing;
35using System.Drawing.Imaging; 36using System.Drawing.Imaging;
37using System.IO.Compression;
36using PrimMesher; 38using PrimMesher;
37using log4net; 39using log4net;
38using Nini.Config; 40using Nini.Config;
@@ -268,6 +270,69 @@ namespace OpenSim.Region.Physics.Meshing
268 { 270 {
269 // add code for mesh physics proxy generation here 271 // add code for mesh physics proxy generation here
270 m_log.Debug("[MESH]: mesh proxy generation not implemented yet "); 272 m_log.Debug("[MESH]: mesh proxy generation not implemented yet ");
273
274 OSD meshOsd;
275
276 if (primShape.SculptData.Length > 0)
277 {
278
279
280 m_log.Debug("[MESH]: asset data length: " + primShape.SculptData.Length.ToString());
281 byte[] header = Util.StringToBytes256("<? LLSD/Binary ?>");
282
283 ////dump to debugging file
284 //string filename = System.IO.Path.Combine(decodedSculptMapPath, "mesh_" + primShape.SculptTexture.ToString());
285 //BinaryWriter writer = new BinaryWriter(File.Open(filename, FileMode.Create));
286 //writer.Write(primShape.SculptData);
287 //writer.Close();
288
289 }
290 else
291 {
292 m_log.Error("[MESH]: asset data is zero length");
293 return null;
294 }
295
296 try
297 {
298 meshOsd = OSDParser.DeserializeLLSDBinary(primShape.SculptData, true);
299 }
300 catch (Exception e)
301 {
302 m_log.Error("[MESH]: exception decoding mesh asset: " + e.ToString());
303 return null;
304 }
305
306 if (meshOsd is OSDMap)
307 {
308 OSDMap map = (OSDMap)meshOsd;
309 //foreach (string name in map.Keys)
310 // m_log.Debug("[MESH]: key:" + name + " value:" + map[name].AsString());
311 OSDMap physicsParms = (OSDMap)map["physics_shape"];
312 int physOffset = physicsParms["offset"].AsInteger();
313 int physSize = physicsParms["size"].AsInteger();
314
315 if (physOffset < 0 || physSize == 0)
316 return null; // no mesh data in asset
317
318 m_log.Debug("[MESH]: physOffset:" + physOffset.ToString() + " physSize:" + physSize.ToString());
319 //MemoryStream ms = new MemoryStream(primShape.SculptData, physOffset, physSize);
320 //GZipStream gzStream = new GZipStream(ms, CompressionMode.Decompress);
321
322 //int maxSize = physSize * 5; // arbitrary guess
323 //byte[] readBuffer = new byte[maxSize];
324
325 //int bytesRead = gzStream.Read(readBuffer, 0, maxSize);
326
327 //OSD physMeshOsd = OSDParser.DeserializeLLSDBinary(readBuffer);
328
329
330
331
332
333 }
334
335 //just bail out for now until mesh code is finished
271 return null; 336 return null;
272 337
273 } 338 }
diff --git a/bin/OpenMetaverse.StructuredData.XML b/bin/OpenMetaverse.StructuredData.XML
index 35f2864..2a0426c 100644
--- a/bin/OpenMetaverse.StructuredData.XML
+++ b/bin/OpenMetaverse.StructuredData.XML
@@ -135,33 +135,17 @@
135 </member> 135 </member>
136 <member name="M:OpenMetaverse.StructuredData.OSDParser.DeserializeLLSDBinary(System.Byte[])"> 136 <member name="M:OpenMetaverse.StructuredData.OSDParser.DeserializeLLSDBinary(System.Byte[])">
137 <summary> 137 <summary>
138 Deserializes binary LLSD 138
139 </summary>
140 <param name="binaryData">Serialized data</param>
141 <returns>OSD containting deserialized data</returns>
142 </member>
143 <member name="M:OpenMetaverse.StructuredData.OSDParser.DeserializeLLSDBinary(System.Byte[],System.Boolean)">
144 <summary>
145 Deserializes binary LLSD
146 </summary> 139 </summary>
147 <param name="binaryData">Serialized data</param> 140 <param name="binaryData"></param>
148 <param name="headerOptional">Treat LLSD binary header as optional</param> 141 <returns></returns>
149 <returns>OSD containting deserialized data</returns>
150 </member> 142 </member>
151 <member name="M:OpenMetaverse.StructuredData.OSDParser.DeserializeLLSDBinary(System.IO.Stream)"> 143 <member name="M:OpenMetaverse.StructuredData.OSDParser.DeserializeLLSDBinary(System.IO.Stream)">
152 <summary> 144 <summary>
153 Deserializes binary LLSD 145
154 </summary>
155 <param name="stream">Stream to read the data from</param>
156 <returns>OSD containting deserialized data</returns>
157 </member>
158 <member name="M:OpenMetaverse.StructuredData.OSDParser.DeserializeLLSDBinary(System.IO.Stream,System.Boolean)">
159 <summary>
160 Deserializes binary LLSD
161 </summary> 146 </summary>
162 <param name="stream">Stream to read the data from</param> 147 <param name="stream"></param>
163 <param name="headerOptional">Treat LLSD binary header as optional</param> 148 <returns></returns>
164 <returns>OSD containting deserialized data</returns>
165 </member> 149 </member>
166 <member name="M:OpenMetaverse.StructuredData.OSDParser.SerializeLLSDBinary(OpenMetaverse.StructuredData.OSD)"> 150 <member name="M:OpenMetaverse.StructuredData.OSDParser.SerializeLLSDBinary(OpenMetaverse.StructuredData.OSD)">
167 <summary> 151 <summary>
diff --git a/prebuild.xml b/prebuild.xml
index abe6934..cc0424a 100644
--- a/prebuild.xml
+++ b/prebuild.xml
@@ -587,9 +587,11 @@
587 <ReferencePath>../../../../bin/</ReferencePath> 587 <ReferencePath>../../../../bin/</ReferencePath>
588 <Reference name="System"/> 588 <Reference name="System"/>
589 <Reference name="System.Drawing"/> 589 <Reference name="System.Drawing"/>
590 <Reference name="System.IO.Compression;"/>
590 <Reference name="CSJ2K" path="../../../../bin/"/> 591 <Reference name="CSJ2K" path="../../../../bin/"/>
591 <Reference name="OpenMetaverseTypes" path="../../../../bin/"/> 592 <Reference name="OpenMetaverseTypes" path="../../../../bin/"/>
592 <Reference name="OpenMetaverse" path="../../../../bin/"/> 593 <Reference name="OpenMetaverse" path="../../../../bin/"/>
594 <Reference name="OpenMetaverse.StructuredData" path="../../../../bin/"/>
593 <Reference name="Nini" path="../../../../bin/"/> 595 <Reference name="Nini" path="../../../../bin/"/>
594 <Reference name="OpenSim.Framework"/> 596 <Reference name="OpenSim.Framework"/>
595 <Reference name="OpenSim.Framework.Console"/> 597 <Reference name="OpenSim.Framework.Console"/>