diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs | 40 |
1 files changed, 31 insertions, 9 deletions
diff --git a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs index 6aa28e0..2105be1 100644 --- a/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/ChOdePlugin/ODEPrim.cs | |||
@@ -131,6 +131,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
131 | //public GCHandle gc; | 131 | //public GCHandle gc; |
132 | private CollisionLocker ode; | 132 | private CollisionLocker ode; |
133 | 133 | ||
134 | private bool m_meshfailed = false; | ||
134 | private bool m_taintforce = false; | 135 | private bool m_taintforce = false; |
135 | private bool m_taintaddangularforce = false; | 136 | private bool m_taintaddangularforce = false; |
136 | private Vector3 m_force; | 137 | private Vector3 m_force; |
@@ -1882,12 +1883,20 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1882 | 1883 | ||
1883 | m_targetSpace = targetspace; | 1884 | m_targetSpace = targetspace; |
1884 | 1885 | ||
1885 | if (_mesh == null) | 1886 | if (_mesh == null && m_meshfailed == false) |
1886 | { | 1887 | { |
1887 | if (_parent_scene.needsMeshing(_pbs)) | 1888 | if (_parent_scene.needsMeshing(_pbs)) |
1888 | { | 1889 | { |
1889 | // Don't need to re-enable body.. it's done in SetMesh | 1890 | // Don't need to re-enable body.. it's done in SetMesh |
1890 | _mesh = _parent_scene.mesher.CreateMesh(m_primName, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical); | 1891 | try |
1892 | { | ||
1893 | _mesh = _parent_scene.mesher.CreateMesh(m_primName, _pbs, _size, _parent_scene.meshSculptLOD, IsPhysical); | ||
1894 | } | ||
1895 | catch | ||
1896 | { | ||
1897 | //Don't continuously try to mesh prims when meshing has failed | ||
1898 | m_meshfailed = true; | ||
1899 | } | ||
1891 | // createmesh returns null when it's a shape that isn't a cube. | 1900 | // createmesh returns null when it's a shape that isn't a cube. |
1892 | // m_log.Debug(m_localID); | 1901 | // m_log.Debug(m_localID); |
1893 | } | 1902 | } |
@@ -2127,7 +2136,7 @@ Console.WriteLine(" JointCreateFixed"); | |||
2127 | // we don't need to do space calculation because the client sends a position update also. | 2136 | // we don't need to do space calculation because the client sends a position update also. |
2128 | 2137 | ||
2129 | // Construction of new prim | 2138 | // Construction of new prim |
2130 | if (_parent_scene.needsMeshing(_pbs)) | 2139 | if (_parent_scene.needsMeshing(_pbs) && m_meshfailed == false) |
2131 | { | 2140 | { |
2132 | float meshlod = _parent_scene.meshSculptLOD; | 2141 | float meshlod = _parent_scene.meshSculptLOD; |
2133 | 2142 | ||
@@ -2137,8 +2146,15 @@ Console.WriteLine(" JointCreateFixed"); | |||
2137 | 2146 | ||
2138 | IMesh mesh = null; | 2147 | IMesh mesh = null; |
2139 | 2148 | ||
2140 | if (_parent_scene.needsMeshing(_pbs)) | 2149 | try |
2141 | mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical); | 2150 | { |
2151 | if (_parent_scene.needsMeshing(_pbs)) | ||
2152 | mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical); | ||
2153 | } | ||
2154 | catch | ||
2155 | { | ||
2156 | m_meshfailed = true; | ||
2157 | } | ||
2142 | 2158 | ||
2143 | //IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical); | 2159 | //IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical); |
2144 | //Console.WriteLine("changesize 1"); | 2160 | //Console.WriteLine("changesize 1"); |
@@ -2233,17 +2249,23 @@ Console.WriteLine(" JointCreateFixed"); | |||
2233 | if (_size.Z <= 0) _size.Z = 0.01f; | 2249 | if (_size.Z <= 0) _size.Z = 0.01f; |
2234 | // Construction of new prim | 2250 | // Construction of new prim |
2235 | 2251 | ||
2236 | if (_parent_scene.needsMeshing(_pbs)) | 2252 | if (_parent_scene.needsMeshing(_pbs) && m_meshfailed == false) |
2237 | { | 2253 | { |
2238 | // Don't need to re-enable body.. it's done in SetMesh | 2254 | // Don't need to re-enable body.. it's done in SetMesh |
2239 | float meshlod = _parent_scene.meshSculptLOD; | 2255 | float meshlod = _parent_scene.meshSculptLOD; |
2240 | 2256 | ||
2241 | if (IsPhysical) | 2257 | if (IsPhysical) |
2242 | meshlod = _parent_scene.MeshSculptphysicalLOD; | 2258 | meshlod = _parent_scene.MeshSculptphysicalLOD; |
2243 | 2259 | try | |
2244 | IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical); | 2260 | { |
2261 | IMesh mesh = _parent_scene.mesher.CreateMesh(oldname, _pbs, _size, meshlod, IsPhysical); | ||
2262 | CreateGeom(m_targetSpace, mesh); | ||
2263 | } | ||
2264 | catch | ||
2265 | { | ||
2266 | m_meshfailed = true; | ||
2267 | } | ||
2245 | // createmesh returns null when it doesn't mesh. | 2268 | // createmesh returns null when it doesn't mesh. |
2246 | CreateGeom(m_targetSpace, mesh); | ||
2247 | } | 2269 | } |
2248 | else | 2270 | else |
2249 | { | 2271 | { |