aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODEPrim.cs123
1 files changed, 102 insertions, 21 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs
index c86084c..5a1fdf9 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, BadAssetColideBits());
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, BadAssetColideBits());
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 }
@@ -816,6 +851,11 @@ namespace OpenSim.Region.Physics.OdePlugin
816 851
817 private static Dictionary<IMesh, IntPtr> m_MeshToTriMeshMap = new Dictionary<IMesh, IntPtr>(); 852 private static Dictionary<IMesh, IntPtr> m_MeshToTriMeshMap = new Dictionary<IMesh, IntPtr>();
818 853
854 public int BadAssetColideBits()
855 {
856 return (m_isphysical ? (int)CollisionCategories.Land : 0);
857 }
858
819 private void setMesh(OdeScene parent_scene, IMesh mesh) 859 private void setMesh(OdeScene parent_scene, IMesh mesh)
820 { 860 {
821// m_log.DebugFormat("[ODE PRIM]: Setting mesh on {0} to {1}", Name, mesh); 861// m_log.DebugFormat("[ODE PRIM]: Setting mesh on {0} to {1}", Name, mesh);
@@ -1094,8 +1134,16 @@ Console.WriteLine("ZProcessTaints for " + Name);
1094 prm.m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); 1134 prm.m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
1095 1135
1096//Console.WriteLine(" GeomSetCategoryBits 1: " + prm.prim_geom + " - " + (int)prm.m_collisionCategories + " for " + Name); 1136//Console.WriteLine(" GeomSetCategoryBits 1: " + prm.prim_geom + " - " + (int)prm.m_collisionCategories + " for " + Name);
1097 d.GeomSetCategoryBits(prm.prim_geom, (int)prm.m_collisionCategories); 1137 if (prm.m_assetFailed)
1098 d.GeomSetCollideBits(prm.prim_geom, (int)prm.m_collisionFlags); 1138 {
1139 d.GeomSetCategoryBits(prm.prim_geom, 0);
1140 d.GeomSetCollideBits(prm.prim_geom, prm.BadAssetColideBits());
1141 }
1142 else
1143 {
1144 d.GeomSetCategoryBits(prm.prim_geom, (int)prm.m_collisionCategories);
1145 d.GeomSetCollideBits(prm.prim_geom, (int)prm.m_collisionFlags);
1146 }
1099 1147
1100 d.Quaternion quat = new d.Quaternion(); 1148 d.Quaternion quat = new d.Quaternion();
1101 quat.W = prm._orientation.W; 1149 quat.W = prm._orientation.W;
@@ -1140,10 +1188,18 @@ Console.WriteLine("ZProcessTaints for " + Name);
1140 m_collisionCategories |= CollisionCategories.Body; 1188 m_collisionCategories |= CollisionCategories.Body;
1141 m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); 1189 m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
1142 1190
1143//Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + Name); 1191 if (m_assetFailed)
1144 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); 1192 {
1145//Console.WriteLine(" Post GeomSetCategoryBits 2"); 1193 d.GeomSetCategoryBits(prim_geom, 0);
1146 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 1194 d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
1195 }
1196 else
1197 {
1198 //Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + Name);
1199 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
1200 //Console.WriteLine(" Post GeomSetCategoryBits 2");
1201 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
1202 }
1147 1203
1148 d.Quaternion quat2 = new d.Quaternion(); 1204 d.Quaternion quat2 = new d.Quaternion();
1149 quat2.W = _orientation.W; 1205 quat2.W = _orientation.W;
@@ -1304,8 +1360,16 @@ Console.WriteLine("ZProcessTaints for " + Name);
1304 disableBodySoft(); 1360 disableBodySoft();
1305 } 1361 }
1306 1362
1307 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); 1363 if (m_assetFailed)
1308 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 1364 {
1365 d.GeomSetCategoryBits(prim_geom, 0);
1366 d.GeomSetCollideBits(prim_geom, 0);
1367 }
1368 else
1369 {
1370 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
1371 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
1372 }
1309 1373
1310 if (IsPhysical) 1374 if (IsPhysical)
1311 { 1375 {
@@ -1326,8 +1390,16 @@ Console.WriteLine("ZProcessTaints for " + Name);
1326 if (m_collidesWater) 1390 if (m_collidesWater)
1327 m_collisionFlags |= CollisionCategories.Water; 1391 m_collisionFlags |= CollisionCategories.Water;
1328 1392
1329 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); 1393 if (m_assetFailed)
1330 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 1394 {
1395 d.GeomSetCategoryBits(prim_geom, 0);
1396 d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
1397 }
1398 else
1399 {
1400 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories);
1401 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
1402 }
1331 1403
1332 if (IsPhysical) 1404 if (IsPhysical)
1333 { 1405 {
@@ -1504,6 +1576,8 @@ Console.WriteLine("CreateGeom:");
1504 // m_log.Debug(m_localID); 1576 // m_log.Debug(m_localID);
1505 if (mesh == null) 1577 if (mesh == null)
1506 CheckMeshAsset(); 1578 CheckMeshAsset();
1579 else
1580 m_assetFailed = false;
1507 } 1581 }
1508 1582
1509#if SPAM 1583#if SPAM
@@ -2007,6 +2081,8 @@ Console.WriteLine(" JointCreateFixed");
2007 mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical); 2081 mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical);
2008 if (mesh == null) 2082 if (mesh == null)
2009 CheckMeshAsset(); 2083 CheckMeshAsset();
2084 else
2085 m_assetFailed = false;
2010 } 2086 }
2011 2087
2012 } 2088 }
@@ -2060,9 +2136,12 @@ Console.WriteLine(" JointCreateFixed");
2060 m_collisionFlags &= ~CollisionCategories.Water; 2136 m_collisionFlags &= ~CollisionCategories.Water;
2061 } 2137 }
2062 2138
2063 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 2139 if (m_assetFailed)
2064 } 2140 d.GeomSetCollideBits(prim_geom, BadAssetColideBits());
2141 else
2065 2142
2143 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags);
2144 }
2066 /// <summary> 2145 /// <summary>
2067 /// Change prim in response to a shape taint. 2146 /// Change prim in response to a shape taint.
2068 /// </summary> 2147 /// </summary>
@@ -2110,6 +2189,8 @@ Console.WriteLine(" JointCreateFixed");
2110 mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical); 2189 mesh = _parent_scene.mesher.CreateMesh(Name, _pbs, _size, meshlod, IsPhysical);
2111 if (mesh == null) 2190 if (mesh == null)
2112 CheckMeshAsset(); 2191 CheckMeshAsset();
2192 else
2193 m_assetFailed = false;
2113 } 2194 }
2114 2195
2115 CreateGeom(m_targetSpace, mesh); 2196 CreateGeom(m_targetSpace, mesh);
@@ -3278,7 +3359,7 @@ Console.WriteLine(" JointCreateFixed");
3278 3359
3279 _pbs.SculptData = new byte[asset.Data.Length]; 3360 _pbs.SculptData = new byte[asset.Data.Length];
3280 asset.Data.CopyTo(_pbs.SculptData, 0); 3361 asset.Data.CopyTo(_pbs.SculptData, 0);
3281 m_assetFailed = false; 3362// m_assetFailed = false;
3282 m_taintshape = true; 3363 m_taintshape = true;
3283 _parent_scene.AddPhysicsActorTaint(this); 3364 _parent_scene.AddPhysicsActorTaint(this);
3284 } 3365 }