diff options
author | UbitUmarov | 2012-08-04 17:33:14 +0100 |
---|---|---|
committer | UbitUmarov | 2012-08-04 17:33:14 +0100 |
commit | 92d44446faad9fef1ec5008b84bf44ab9398f6a9 (patch) | |
tree | b01793beb57694361c37e092424649d0b088cb19 /OpenSim/Region | |
parent | fix build on win (diff) | |
download | opensim-SC_OLD-92d44446faad9fef1ec5008b84bf44ab9398f6a9.zip opensim-SC_OLD-92d44446faad9fef1ec5008b84bf44ab9398f6a9.tar.gz opensim-SC_OLD-92d44446faad9fef1ec5008b84bf44ab9398f6a9.tar.bz2 opensim-SC_OLD-92d44446faad9fef1ec5008b84bf44ab9398f6a9.tar.xz |
*feature test* ubitode, let convex hull shape type work for prims other
than uploaded meshs, making it change the mesh level of detail from high to low.
This will work on all prims that get a internal mesh or sculpts. Mesh size
reduction will depend on particular shape. This is not as SL. There prims
do also get concave areas. Uploaded meshs work as before. A normal 10x10x10 torus gets 152 vertices in place of 900, and 198 faces in place of 1198.
Diffstat (limited to 'OpenSim/Region')
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | 21 |
1 files changed, 15 insertions, 6 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs index 6bf5be1..a3534a4 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs | |||
@@ -1092,18 +1092,21 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1092 | CalcPrimBodyData(); | 1092 | CalcPrimBodyData(); |
1093 | 1093 | ||
1094 | m_mesh = null; | 1094 | m_mesh = null; |
1095 | if (_parent_scene.needsMeshing(pbs)) | 1095 | if (_parent_scene.needsMeshing(pbs) && (pbs.SculptData.Length > 0)) |
1096 | { | 1096 | { |
1097 | bool convex; | 1097 | bool convex; |
1098 | int clod = (int)LevelOfDetail.High; | ||
1098 | if (m_shapetype == 0) | 1099 | if (m_shapetype == 0) |
1099 | convex = false; | 1100 | convex = false; |
1100 | else | 1101 | else |
1102 | { | ||
1101 | convex = true; | 1103 | convex = true; |
1102 | 1104 | if (_pbs.SculptType != (byte)SculptType.Mesh) | |
1103 | m_mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, (int)LevelOfDetail.High, true, convex); | 1105 | clod = (int)LevelOfDetail.Low; |
1106 | } | ||
1107 | m_mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, clod, true, convex); | ||
1104 | } | 1108 | } |
1105 | 1109 | ||
1106 | |||
1107 | m_building = true; // control must set this to false when done | 1110 | m_building = true; // control must set this to false when done |
1108 | 1111 | ||
1109 | AddChange(changes.Add, null); | 1112 | AddChange(changes.Add, null); |
@@ -1360,12 +1363,18 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1360 | if (m_mesh == null) | 1363 | if (m_mesh == null) |
1361 | { | 1364 | { |
1362 | bool convex; | 1365 | bool convex; |
1366 | int clod = (int)LevelOfDetail.High; | ||
1367 | |||
1363 | if (m_shapetype == 0) | 1368 | if (m_shapetype == 0) |
1364 | convex = false; | 1369 | convex = false; |
1365 | else | 1370 | else |
1371 | { | ||
1366 | convex = true; | 1372 | convex = true; |
1373 | if (_pbs.SculptType != (byte)SculptType.Mesh) | ||
1374 | clod = (int)LevelOfDetail.Low; | ||
1375 | } | ||
1367 | 1376 | ||
1368 | mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, (int)LevelOfDetail.High, true, convex); | 1377 | mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, clod, true, convex); |
1369 | } | 1378 | } |
1370 | else | 1379 | else |
1371 | { | 1380 | { |
@@ -1373,7 +1382,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1373 | } | 1382 | } |
1374 | 1383 | ||
1375 | if (mesh == null) | 1384 | if (mesh == null) |
1376 | { | 1385 | { |
1377 | m_log.WarnFormat("[PHYSICS]: CreateMesh Failed on prim {0} at <{1},{2},{3}>.", Name, _position.X, _position.Y, _position.Z); | 1386 | m_log.WarnFormat("[PHYSICS]: CreateMesh Failed on prim {0} at <{1},{2},{3}>.", Name, _position.X, _position.Y, _position.Z); |
1378 | return false; | 1387 | return false; |
1379 | } | 1388 | } |