aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs28
1 files changed, 20 insertions, 8 deletions
diff --git a/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
index 61fb2d0..7a1e671 100644
--- a/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/ChOdePlugin/OdePlugin.cs
@@ -1772,7 +1772,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1772 IMesh mesh = null; 1772 IMesh mesh = null;
1773 1773
1774 if (needsMeshing(pbs)) 1774 if (needsMeshing(pbs))
1775 mesh = mesher.CreateMesh(primName, pbs, size, 32f, isPhysical); 1775 mesh = mesher.CreateMesh(primName, pbs, size, (int)LevelOfDetail.High, true);
1776 1776
1777 result = AddPrim(primName, position, size, rotation, mesh, pbs, isPhysical, localid); 1777 result = AddPrim(primName, position, size, rotation, mesh, pbs, isPhysical, localid);
1778 1778
@@ -2174,6 +2174,16 @@ namespace OpenSim.Region.Physics.OdePlugin
2174 { 2174 {
2175 prim.ResetTaints(); 2175 prim.ResetTaints();
2176 2176
2177 try
2178 {
2179 if (prim._triMeshData != IntPtr.Zero)
2180 {
2181 d.GeomTriMeshDataDestroy(prim._triMeshData);
2182 prim._triMeshData = IntPtr.Zero;
2183 }
2184 }
2185 catch { };
2186
2177 if (prim.IsPhysical) 2187 if (prim.IsPhysical)
2178 { 2188 {
2179 prim.disableBody(); 2189 prim.disableBody();
@@ -2185,7 +2195,6 @@ namespace OpenSim.Region.Physics.OdePlugin
2185 prim.IsPhysical = false; 2195 prim.IsPhysical = false;
2186 } 2196 }
2187 2197
2188
2189 } 2198 }
2190 // we don't want to remove the main space 2199 // we don't want to remove the main space
2191 2200
@@ -2505,7 +2514,7 @@ namespace OpenSim.Region.Physics.OdePlugin
2505 } 2514 }
2506 2515
2507 // if it's a standard box or sphere with no cuts, hollows, twist or top shear, return false since ODE can use an internal representation for the prim 2516 // if it's a standard box or sphere with no cuts, hollows, twist or top shear, return false since ODE can use an internal representation for the prim
2508 if (!forceSimplePrimMeshing) 2517 if (!forceSimplePrimMeshing && !pbs.SculptEntry)
2509 { 2518 {
2510 if ((pbs.ProfileShape == ProfileShape.Square && pbs.PathCurve == (byte)Extrusion.Straight) 2519 if ((pbs.ProfileShape == ProfileShape.Square && pbs.PathCurve == (byte)Extrusion.Straight)
2511 || (pbs.ProfileShape == ProfileShape.HalfCircle && pbs.PathCurve == (byte)Extrusion.Curve1 2520 || (pbs.ProfileShape == ProfileShape.HalfCircle && pbs.PathCurve == (byte)Extrusion.Curve1
@@ -2528,6 +2537,9 @@ namespace OpenSim.Region.Physics.OdePlugin
2528 } 2537 }
2529 } 2538 }
2530 2539
2540 if (forceSimplePrimMeshing)
2541 return true;
2542
2531 if (pbs.ProfileHollow != 0) 2543 if (pbs.ProfileHollow != 0)
2532 iPropertiesNotSupportedDefault++; 2544 iPropertiesNotSupportedDefault++;
2533 2545
@@ -2592,6 +2604,8 @@ namespace OpenSim.Region.Physics.OdePlugin
2592 } 2604 }
2593 } 2605 }
2594 2606
2607 if (pbs.SculptEntry && meshSculptedPrim)
2608 iPropertiesNotSupportedDefault++;
2595 2609
2596 if (iPropertiesNotSupportedDefault == 0) 2610 if (iPropertiesNotSupportedDefault == 0)
2597 { 2611 {
@@ -3443,8 +3457,8 @@ namespace OpenSim.Region.Physics.OdePlugin
3443 int heightmapWidth = regionsize + 2; // ODE map size 257 x 257 (Meters) (1 extra 3457 int heightmapWidth = regionsize + 2; // ODE map size 257 x 257 (Meters) (1 extra
3444 int heightmapHeight = regionsize + 2; 3458 int heightmapHeight = regionsize + 2;
3445 3459
3446 int heightmapWidthSamples = (int)regionsize + 3; // Sample file size, 258 x 258 samples 3460 int heightmapWidthSamples = (int)regionsize + 2; // Sample file size, 258 x 258 samples
3447 int heightmapHeightSamples = (int)regionsize + 3; 3461 int heightmapHeightSamples = (int)regionsize + 2;
3448 3462
3449 // Array of height samples for ODE 3463 // Array of height samples for ODE
3450 float[] _heightmap; 3464 float[] _heightmap;
@@ -3481,7 +3495,7 @@ namespace OpenSim.Region.Physics.OdePlugin
3481 // Output x = 0 1 2 3 ..... 255 256 257 258 total out 3495 // Output x = 0 1 2 3 ..... 255 256 257 258 total out
3482 float val= heightMap[(yy * regionsize) + xx]; // input from heightMap, <0-255 * 256> <0-255> 3496 float val= heightMap[(yy * regionsize) + xx]; // input from heightMap, <0-255 * 256> <0-255>
3483 if (val < minele) val = minele; 3497 if (val < minele) val = minele;
3484 _heightmap[x * (heightmapHeightSamples) + y] = val; // samples output to _heightmap, <0-257 * 258> <0-257> 3498 _heightmap[x * (regionsize + 2) + y] = val; // samples output to _heightmap, <0-257 * 258> <0-257>
3485 hfmin = (val < hfmin) ? val : hfmin; 3499 hfmin = (val < hfmin) ? val : hfmin;
3486 hfmax = (val > hfmax) ? val : hfmax; 3500 hfmax = (val > hfmax) ? val : hfmax;
3487 } 3501 }
@@ -3531,8 +3545,6 @@ namespace OpenSim.Region.Physics.OdePlugin
3531 d.RFromAxisAndAngle(out R, v3.X, v3.Y, v3.Z, angle); 3545 d.RFromAxisAndAngle(out R, v3.X, v3.Y, v3.Z, angle);
3532 d.GeomSetRotation(GroundGeom, ref R); 3546 d.GeomSetRotation(GroundGeom, ref R);
3533 d.GeomSetPosition(GroundGeom, (pOffset.X + (regionsize * 0.5f)) - 0.5f, (pOffset.Y + (regionsize * 0.5f)) - 0.5f, 0); 3547 d.GeomSetPosition(GroundGeom, (pOffset.X + (regionsize * 0.5f)) - 0.5f, (pOffset.Y + (regionsize * 0.5f)) - 0.5f, 0);
3534 // having nsamples = size + 1 center is actually at size/2
3535 d.GeomSetPosition(GroundGeom, (pOffset.X + (regionsize * 0.5f)), (pOffset.Y + (regionsize * 0.5f)), 0);
3536 IntPtr testGround = IntPtr.Zero; 3548 IntPtr testGround = IntPtr.Zero;
3537 if (RegionTerrain.TryGetValue(pOffset, out testGround)) 3549 if (RegionTerrain.TryGetValue(pOffset, out testGround))
3538 { 3550 {