aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs118
1 files changed, 97 insertions, 21 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index c86084c..a6c657f 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
@@ -341,8 +341,17 @@ namespace OpenSim.Region.Physics.OdePlugin
341 prim_geom = geom; 341 prim_geom = geom;
342//Console.WriteLine("SetGeom to " + prim_geom + " for " + Name); 342//Console.WriteLine("SetGeom to " + prim_geom + " for " + Name);
343 343
344 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); 344 if (m_assetFailed)
345 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 345 {
346 d.GeomSetCategoryBits(prim_geom, 0);
347 d.GeomSetCollideBits(prim_geom, 0);
348 }
349 else
350 {
351
352 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
353 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
354 }
346 355
347 _parent_scene.geom_name_map[prim_geom] = Name; 356 _parent_scene.geom_name_map[prim_geom] = Name;
348 _parent_scene.actor_name_map[prim_geom] = this; 357 _parent_scene.actor_name_map[prim_geom] = this;
@@ -405,8 +414,17 @@ namespace OpenSim.Region.Physics.OdePlugin
405 myrot.W = _orientation.W; 414 myrot.W = _orientation.W;
406 d.BodySetQuaternion(Body, ref myrot); 415 d.BodySetQuaternion(Body, ref myrot);
407 d.GeomSetBody(prim_geom, Body); 416 d.GeomSetBody(prim_geom, Body);
408 m_collisionCategories |= CollisionCategories.Body; 417
409 m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); 418 if (m_assetFailed)
419 {
420 d.GeomSetCategoryBits(prim_geom, 0);
421 d.GeomSetCollideBits(prim_geom, 0);
422 }
423 else
424 {
425 m_collisionCategories |= CollisionCategories.Body;
426 m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
427 }
410 428
411 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); 429 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
412 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 430 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
@@ -778,8 +796,16 @@ namespace OpenSim.Region.Physics.OdePlugin
778 m_collisionCategories &= ~CollisionCategories.Body; 796 m_collisionCategories &= ~CollisionCategories.Body;
779 m_collisionFlags &= ~(CollisionCategories.Wind | CollisionCategories.Land); 797 m_collisionFlags &= ~(CollisionCategories.Wind | CollisionCategories.Land);
780 798
781 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); 799 if (m_assetFailed)
782 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 800 {
801 d.GeomSetCategoryBits(prim_geom, 0);
802 d.GeomSetCollideBits(prim_geom, 0);
803 }
804 else
805 {
806 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
807 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
808 }
783 809
784 d.BodyDestroy(Body); 810 d.BodyDestroy(Body);
785 lock (childrenPrim) 811 lock (childrenPrim)
@@ -803,8 +829,17 @@ namespace OpenSim.Region.Physics.OdePlugin
803 m_collisionCategories &= ~CollisionCategories.Body; 829 m_collisionCategories &= ~CollisionCategories.Body;
804 m_collisionFlags &= ~(CollisionCategories.Wind | CollisionCategories.Land); 830 m_collisionFlags &= ~(CollisionCategories.Wind | CollisionCategories.Land);
805 831
806 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); 832 if (m_assetFailed)
807 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 833 {
834 d.GeomSetCategoryBits(prim_geom, 0);
835 d.GeomSetCollideBits(prim_geom, 0);
836 }
837 else
838 {
839
840 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
841 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
842 }
808 843
809 Body = IntPtr.Zero; 844 Body = IntPtr.Zero;
810 } 845 }
@@ -1094,8 +1129,16 @@ Console.WriteLine("ZProcessTaints for " + Name);
1094 prm.m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); 1129 prm.m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
1095 1130
1096//Console.WriteLine(" GeomSetCategoryBits 1: " + prm.prim_geom + " - " + (int)prm.m_collisionCategories + " for " + Name); 1131//Console.WriteLine(" GeomSetCategoryBits 1: " + prm.prim_geom + " - " + (int)prm.m_collisionCategories + " for " + Name);
1097 d.GeomSetCategoryBits(prm.prim_geom, (int)prm.m_collisionCategories); 1132 if (prm.m_assetFailed)
1098 d.GeomSetCollideBits(prm.prim_geom, (int)prm.m_collisionFlags); 1133 {
1134 d.GeomSetCategoryBits(prm.prim_geom, 0);
1135 d.GeomSetCollideBits(prm.prim_geom, 0);
1136 }
1137 else
1138 {
1139 d.GeomSetCategoryBits(prm.prim_geom, (int)prm.m_collisionCategories);
1140 d.GeomSetCollideBits(prm.prim_geom, (int)prm.m_collisionFlags);
1141 }
1099 1142
1100 d.Quaternion quat = new d.Quaternion(); 1143 d.Quaternion quat = new d.Quaternion();
1101 quat.W = prm._orientation.W; 1144 quat.W = prm._orientation.W;
@@ -1140,10 +1183,18 @@ Console.WriteLine("ZProcessTaints for " + Name);
1140 m_collisionCategories |= CollisionCategories.Body; 1183 m_collisionCategories |= CollisionCategories.Body;
1141 m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); 1184 m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
1142 1185
1143//Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + Name); 1186 if (m_assetFailed)
1144 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); 1187 {
1145//Console.WriteLine(" Post GeomSetCategoryBits 2"); 1188 d.GeomSetCategoryBits(prim_geom, 0);
1146 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 1189 d.GeomSetCollideBits(prim_geom, 0);
1190 }
1191 else
1192 {
1193 //Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + Name);
1194 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
1195 //Console.WriteLine(" Post GeomSetCategoryBits 2");
1196 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
1197 }
1147 1198
1148 d.Quaternion quat2 = new d.Quaternion(); 1199 d.Quaternion quat2 = new d.Quaternion();
1149 quat2.W = _orientation.W; 1200 quat2.W = _orientation.W;
@@ -1304,8 +1355,16 @@ Console.WriteLine("ZProcessTaints for " + Name);
1304 disableBodySoft(); 1355 disableBodySoft();
1305 } 1356 }
1306 1357
1307 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); 1358 if (m_assetFailed)
1308 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 1359 {
1360 d.GeomSetCategoryBits(prim_geom, 0);
1361 d.GeomSetCollideBits(prim_geom, 0);
1362 }
1363 else
1364 {
1365 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
1366 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
1367 }
1309 1368
1310 if (IsPhysical) 1369 if (IsPhysical)
1311 { 1370 {
@@ -1326,8 +1385,16 @@ Console.WriteLine("ZProcessTaints for " + Name);
1326 if (m_collidesWater) 1385 if (m_collidesWater)
1327 m_collisionFlags |= CollisionCategories.Water; 1386 m_collisionFlags |= CollisionCategories.Water;
1328 1387
1329 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); 1388 if (m_assetFailed)
1330 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 1389 {
1390 d.GeomSetCategoryBits(prim_geom, 0);
1391 d.GeomSetCollideBits(prim_geom, 0);
1392 }
1393 else
1394 {
1395 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
1396 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
1397 }
1331 1398
1332 if (IsPhysical) 1399 if (IsPhysical)
1333 { 1400 {
@@ -1504,6 +1571,8 @@ Console.WriteLine("CreateGeom:");
1504 // m_log.Debug(m_localID); 1571 // m_log.Debug(m_localID);
1505 if (mesh == null) 1572 if (mesh == null)
1506 CheckMeshAsset(); 1573 CheckMeshAsset();
1574 else
1575 m_assetFailed = false;
1507 } 1576 }
1508 1577
1509#if SPAM 1578#if SPAM
@@ -2007,6 +2076,8 @@ Console.WriteLine(" JointCreateFixed");
2007 mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical); 2076 mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical);
2008 if (mesh == null) 2077 if (mesh == null)
2009 CheckMeshAsset(); 2078 CheckMeshAsset();
2079 else
2080 m_assetFailed = false;
2010 } 2081 }
2011 2082
2012 } 2083 }
@@ -2060,9 +2131,12 @@ Console.WriteLine(" JointCreateFixed");
2060 m_collisionFlags &= ~CollisionCategories.Water; 2131 m_collisionFlags &= ~CollisionCategories.Water;
2061 } 2132 }
2062 2133
2063 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 2134 if (m_assetFailed)
2064 } 2135 d.GeomSetCollideBits(prim_geom, 0);
2136 else
2065 2137
2138 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
2139 }
2066 /// <summary> 2140 /// <summary>
2067 /// Change prim in response to a shape taint. 2141 /// Change prim in response to a shape taint.
2068 /// </summary> 2142 /// </summary>
@@ -2110,6 +2184,8 @@ Console.WriteLine(" JointCreateFixed");
2110 mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical); 2184 mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical);
2111 if (mesh == null) 2185 if (mesh == null)
2112 CheckMeshAsset(); 2186 CheckMeshAsset();
2187 else
2188 m_assetFailed = false;
2113 } 2189 }
2114 2190
2115 CreateGeom(m_targetSpace, mesh); 2191 CreateGeom(m_targetSpace, mesh);
@@ -3278,7 +3354,7 @@ Console.WriteLine(" JointCreateFixed");
3278 3354
3279 _pbs.SculptData = new byte[asset.Data.Length]; 3355 _pbs.SculptData = new byte[asset.Data.Length];
3280 asset.Data.CopyTo(_pbs.SculptData, 0); 3356 asset.Data.CopyTo(_pbs.SculptData, 0);
3281 m_assetFailed = false; 3357// m_assetFailed = false;
3282 m_taintshape = true; 3358 m_taintshape = true;
3283 _parent_scene.AddPhysicsActorTaint(this); 3359 _parent_scene.AddPhysicsActorTaint(this);
3284 } 3360 }