minor clean

avinationmerge
UbitUmarov 2012-03-21 21:17:00 +00:00
parent 68736aa460
commit 4f593fa8c3
1 changed files with 26 additions and 29 deletions

View File

@ -218,9 +218,20 @@ namespace OpenSim.Region.Physics.Meshing
// geometry for this submesh. // geometry for this submesh.
if (subMeshData.ContainsKey("NoGeometry") && ((OSDBoolean)subMeshData["NoGeometry"])) if (subMeshData.ContainsKey("NoGeometry") && ((OSDBoolean)subMeshData["NoGeometry"]))
return; return;
OpenMetaverse.Vector3 posMax = ((OSDMap)subMeshData["PositionDomain"])["Max"].AsVector3(); OpenMetaverse.Vector3 posMax;
OpenMetaverse.Vector3 posMin = ((OSDMap)subMeshData["PositionDomain"])["Min"].AsVector3(); OpenMetaverse.Vector3 posMin;
if (subMeshData.ContainsKey("PositionDomain"))
{
posMax = ((OSDMap)subMeshData["PositionDomain"])["Max"].AsVector3();
posMin = ((OSDMap)subMeshData["PositionDomain"])["Min"].AsVector3();
}
else
{
posMax = new Vector3(0.5f, 0.5f, 0.5f);
posMin = new Vector3(-0.5f, -0.5f, -0.5f);
}
ushort faceIndexOffset = (ushort)coords.Count; ushort faceIndexOffset = (ushort)coords.Count;
byte[] posBytes = subMeshData["Position"].AsBinary(); byte[] posBytes = subMeshData["Position"].AsBinary();
@ -280,18 +291,14 @@ namespace OpenSim.Region.Physics.Meshing
{ {
if (!GenerateCoordsAndFacesFromPrimSculptData(primName, primShape, size, lod, out coords, out faces)) if (!GenerateCoordsAndFacesFromPrimSculptData(primName, primShape, size, lod, out coords, out faces))
return null; return null;
// Remove the reference to any JPEG2000 sculpt data so it can be GCed
// don't loose it
// primShape.SculptData = Utils.EmptyBytes;
} }
// primShape.SculptDataLoaded = true;
} }
else else
{ {
if (!GenerateCoordsAndFacesFromPrimShapeData(primName, primShape, size, lod, out coords, out faces)) if (!GenerateCoordsAndFacesFromPrimShapeData(primName, primShape, size, lod, out coords, out faces))
return null; return null;
} }
// keep compatible
primShape.SculptData = Utils.EmptyBytes; primShape.SculptData = Utils.EmptyBytes;
int numCoords = coords.Count; int numCoords = coords.Count;
@ -307,10 +314,6 @@ namespace OpenSim.Region.Physics.Meshing
coords[f.v3].X, coords[f.v3].Y, coords[f.v3].Z)); coords[f.v3].X, coords[f.v3].Y, coords[f.v3].Z));
} }
// mesh.DumpRaw("c:\\lixo", "lixo", "lixo");
mesh.DumpRaw(".", "lixo", "lixo");
return mesh; return mesh;
} }
@ -452,22 +455,20 @@ namespace OpenSim.Region.Physics.Meshing
return false; return false;
byte[] data; byte[] data;
List<float3> vs = new List<float3>();
PHullResult hullr = new PHullResult();
float3 f3;
Coord c;
Face f;
Vector3 range;
Vector3 min;
const float invMaxU16 = 1.0f / 65535f; const float invMaxU16 = 1.0f / 65535f;
int t1; int t1;
int t2; int t2;
int t3; int t3;
int i; int i;
List<float3> vs = new List<float3>();
float3 f3;
PHullResult hullr = new PHullResult();
Coord c;
Face f;
Vector3 range;
Vector3 min;
int nverts; int nverts;
int nindexs; int nindexs;
@ -576,8 +577,7 @@ namespace OpenSim.Region.Physics.Meshing
c.Z = hullr.Vertices[i].z; c.Z = hullr.Vertices[i].z;
coords.Add(c); coords.Add(c);
} }
for (i = 0; i < nindexs; i += 3) for (i = 0; i < nindexs; i += 3)
{ {
t1 = hullr.Indices[i]; t1 = hullr.Indices[i];
@ -597,8 +597,7 @@ namespace OpenSim.Region.Physics.Meshing
} }
} }
if (coords.Count > 0 && faces.Count > 0) if (coords.Count > 0 && faces.Count > 0)
return true; return true;
} }
vs.Clear(); vs.Clear();
@ -642,7 +641,6 @@ namespace OpenSim.Region.Physics.Meshing
if (vs.Count == 4) if (vs.Count == 4)
{ {
// not sure about orientation..
f = new Face(0, 2, 3); f = new Face(0, 2, 3);
faces.Add(f); faces.Add(f);
f = new Face(0, 3, 1); f = new Face(0, 3, 1);
@ -690,7 +688,6 @@ namespace OpenSim.Region.Physics.Meshing
} }
else else
return false; return false;
} }
} }