diff options
Diffstat (limited to 'OpenSim')
3 files changed, 47 insertions, 14 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs index f33fdb4..925900f 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | |||
@@ -708,21 +708,21 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
708 | bot += midsz; | 708 | bot += midsz; |
709 | float topz = bot + topsz * 0.5f; | 709 | float topz = bot + topsz * 0.5f; |
710 | 710 | ||
711 | _parent_scene.waitForSpaceUnlock(_parent_scene.ActiveSpace); | 711 | _parent_scene.waitForSpaceUnlock(_parent_scene.CharsSpace); |
712 | 712 | ||
713 | feetbox = d.CreateBox(_parent_scene.ActiveSpace, feetsx, feetsy, feetsz); | 713 | feetbox = d.CreateBox(_parent_scene.CharsSpace, feetsx, feetsy, feetsz); |
714 | d.GeomSetCategoryBits(feetbox, (uint)m_collisionCategories); | 714 | d.GeomSetCategoryBits(feetbox, (uint)m_collisionCategories); |
715 | d.GeomSetCollideBits(feetbox, (uint)m_collisionFlags); | 715 | d.GeomSetCollideBits(feetbox, (uint)m_collisionFlags); |
716 | 716 | ||
717 | midbox = d.CreateBox(_parent_scene.ActiveSpace, midsx, midsy, midsz); | 717 | midbox = d.CreateBox(_parent_scene.CharsSpace, midsx, midsy, midsz); |
718 | d.GeomSetCategoryBits(midbox, (uint)m_collisionCategories); | 718 | d.GeomSetCategoryBits(midbox, (uint)m_collisionCategories); |
719 | d.GeomSetCollideBits(midbox, (uint)m_collisionFlags); | 719 | d.GeomSetCollideBits(midbox, (uint)m_collisionFlags); |
720 | 720 | ||
721 | topbox = d.CreateBox(_parent_scene.ActiveSpace, topsx, topsy, topsz); | 721 | topbox = d.CreateBox(_parent_scene.CharsSpace, topsx, topsy, topsz); |
722 | d.GeomSetCategoryBits(topbox, (uint)m_collisionCategories); | 722 | d.GeomSetCategoryBits(topbox, (uint)m_collisionCategories); |
723 | d.GeomSetCollideBits(topbox, (uint)m_collisionFlags); | 723 | d.GeomSetCollideBits(topbox, (uint)m_collisionFlags); |
724 | 724 | ||
725 | bonebox = d.CreateBox(_parent_scene.ActiveSpace, bonesx, bonesy, bonesz); | 725 | bonebox = d.CreateBox(_parent_scene.CharsSpace, bonesx, bonesy, bonesz); |
726 | d.GeomSetCategoryBits(bonebox, (uint)m_collisionCategories); | 726 | d.GeomSetCategoryBits(bonebox, (uint)m_collisionCategories); |
727 | d.GeomSetCollideBits(bonebox, (uint)m_collisionFlags); | 727 | d.GeomSetCollideBits(bonebox, (uint)m_collisionFlags); |
728 | 728 | ||
@@ -828,21 +828,21 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
828 | if (topbox != IntPtr.Zero) | 828 | if (topbox != IntPtr.Zero) |
829 | { | 829 | { |
830 | _parent_scene.actor_name_map.Remove(topbox); | 830 | _parent_scene.actor_name_map.Remove(topbox); |
831 | _parent_scene.waitForSpaceUnlock(_parent_scene.ActiveSpace); | 831 | _parent_scene.waitForSpaceUnlock(_parent_scene.CharsSpace); |
832 | d.GeomDestroy(topbox); | 832 | d.GeomDestroy(topbox); |
833 | topbox = IntPtr.Zero; | 833 | topbox = IntPtr.Zero; |
834 | } | 834 | } |
835 | if (midbox != IntPtr.Zero) | 835 | if (midbox != IntPtr.Zero) |
836 | { | 836 | { |
837 | _parent_scene.actor_name_map.Remove(midbox); | 837 | _parent_scene.actor_name_map.Remove(midbox); |
838 | _parent_scene.waitForSpaceUnlock(_parent_scene.ActiveSpace); | 838 | _parent_scene.waitForSpaceUnlock(_parent_scene.CharsSpace); |
839 | d.GeomDestroy(midbox); | 839 | d.GeomDestroy(midbox); |
840 | midbox = IntPtr.Zero; | 840 | midbox = IntPtr.Zero; |
841 | } | 841 | } |
842 | if (feetbox != IntPtr.Zero) | 842 | if (feetbox != IntPtr.Zero) |
843 | { | 843 | { |
844 | _parent_scene.actor_name_map.Remove(feetbox); | 844 | _parent_scene.actor_name_map.Remove(feetbox); |
845 | _parent_scene.waitForSpaceUnlock(_parent_scene.ActiveSpace); | 845 | _parent_scene.waitForSpaceUnlock(_parent_scene.CharsSpace); |
846 | d.GeomDestroy(feetbox); | 846 | d.GeomDestroy(feetbox); |
847 | feetbox = IntPtr.Zero; | 847 | feetbox = IntPtr.Zero; |
848 | } | 848 | } |
@@ -850,7 +850,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
850 | if (bonebox != IntPtr.Zero) | 850 | if (bonebox != IntPtr.Zero) |
851 | { | 851 | { |
852 | _parent_scene.actor_name_map.Remove(bonebox); | 852 | _parent_scene.actor_name_map.Remove(bonebox); |
853 | _parent_scene.waitForSpaceUnlock(_parent_scene.ActiveSpace); | 853 | _parent_scene.waitForSpaceUnlock(_parent_scene.CharsSpace); |
854 | d.GeomDestroy(bonebox); | 854 | d.GeomDestroy(bonebox); |
855 | bonebox = IntPtr.Zero; | 855 | bonebox = IntPtr.Zero; |
856 | } | 856 | } |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs index 799a324..f449099 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODERayCastRequestManager.cs | |||
@@ -324,7 +324,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
324 | { | 324 | { |
325 | // Collide tests | 325 | // Collide tests |
326 | if ((CurrentRayFilter & FilterActiveSpace) != 0) | 326 | if ((CurrentRayFilter & FilterActiveSpace) != 0) |
327 | { | ||
327 | d.SpaceCollide2(ray, m_scene.ActiveSpace, IntPtr.Zero, nearCallback); | 328 | d.SpaceCollide2(ray, m_scene.ActiveSpace, IntPtr.Zero, nearCallback); |
329 | d.SpaceCollide2(ray, m_scene.CharsSpace, IntPtr.Zero, nearCallback); | ||
330 | } | ||
328 | if ((CurrentRayFilter & FilterStaticSpace) != 0 && (m_contactResults.Count < CurrentMaxCount)) | 331 | if ((CurrentRayFilter & FilterStaticSpace) != 0 && (m_contactResults.Count < CurrentMaxCount)) |
329 | d.SpaceCollide2(ray, m_scene.StaticSpace, IntPtr.Zero, nearCallback); | 332 | d.SpaceCollide2(ray, m_scene.StaticSpace, IntPtr.Zero, nearCallback); |
330 | if ((CurrentRayFilter & RayFilterFlags.land) != 0 && (m_contactResults.Count < CurrentMaxCount)) | 333 | if ((CurrentRayFilter & RayFilterFlags.land) != 0 && (m_contactResults.Count < CurrentMaxCount)) |
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs index 003a91c..07987d1 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs | |||
@@ -299,6 +299,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
299 | 299 | ||
300 | public IntPtr TopSpace; // the global space | 300 | public IntPtr TopSpace; // the global space |
301 | public IntPtr ActiveSpace; // space for active prims | 301 | public IntPtr ActiveSpace; // space for active prims |
302 | public IntPtr CharsSpace; // space for active prims | ||
302 | public IntPtr StaticSpace; // space for the static things around | 303 | public IntPtr StaticSpace; // space for the static things around |
303 | public IntPtr GroundSpace; // space for ground | 304 | public IntPtr GroundSpace; // space for ground |
304 | 305 | ||
@@ -372,21 +373,25 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
372 | 373 | ||
373 | // now the major subspaces | 374 | // now the major subspaces |
374 | ActiveSpace = d.HashSpaceCreate(TopSpace); | 375 | ActiveSpace = d.HashSpaceCreate(TopSpace); |
376 | CharsSpace = d.HashSpaceCreate(TopSpace); | ||
375 | StaticSpace = d.HashSpaceCreate(TopSpace); | 377 | StaticSpace = d.HashSpaceCreate(TopSpace); |
376 | GroundSpace = d.HashSpaceCreate(TopSpace); | 378 | GroundSpace = d.HashSpaceCreate(TopSpace); |
377 | } | 379 | } |
378 | catch | 380 | catch |
379 | { | 381 | { |
380 | // i must RtC#FM | 382 | // i must RtC#FM |
383 | // i did! | ||
381 | } | 384 | } |
382 | 385 | ||
383 | d.HashSpaceSetLevels(TopSpace, -2, 8); | 386 | d.HashSpaceSetLevels(TopSpace, -2, 8); |
384 | d.HashSpaceSetLevels(ActiveSpace, -2, 8); | 387 | d.HashSpaceSetLevels(ActiveSpace, -2, 8); |
388 | d.HashSpaceSetLevels(CharsSpace, -4, 3); | ||
385 | d.HashSpaceSetLevels(StaticSpace, -2, 8); | 389 | d.HashSpaceSetLevels(StaticSpace, -2, 8); |
386 | d.HashSpaceSetLevels(GroundSpace, 0, 8); | 390 | d.HashSpaceSetLevels(GroundSpace, 0, 8); |
387 | 391 | ||
388 | // demote to second level | 392 | // demote to second level |
389 | d.SpaceSetSublevel(ActiveSpace, 1); | 393 | d.SpaceSetSublevel(ActiveSpace, 1); |
394 | d.SpaceSetSublevel(CharsSpace, 1); | ||
390 | d.SpaceSetSublevel(StaticSpace, 1); | 395 | d.SpaceSetSublevel(StaticSpace, 1); |
391 | d.SpaceSetSublevel(GroundSpace, 1); | 396 | d.SpaceSetSublevel(GroundSpace, 1); |
392 | 397 | ||
@@ -396,11 +401,24 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
396 | CollisionCategories.Phantom | | 401 | CollisionCategories.Phantom | |
397 | CollisionCategories.VolumeDtc | 402 | CollisionCategories.VolumeDtc |
398 | )); | 403 | )); |
399 | d.GeomSetCollideBits(ActiveSpace, 0); | 404 | d.GeomSetCollideBits(ActiveSpace, (uint)(CollisionCategories.Space | |
405 | CollisionCategories.Geom | | ||
406 | CollisionCategories.Character | | ||
407 | CollisionCategories.Phantom | | ||
408 | CollisionCategories.VolumeDtc | ||
409 | )); | ||
410 | d.GeomSetCategoryBits(CharsSpace, (uint)(CollisionCategories.Space | | ||
411 | CollisionCategories.Geom | | ||
412 | CollisionCategories.Character | | ||
413 | CollisionCategories.Phantom | | ||
414 | CollisionCategories.VolumeDtc | ||
415 | )); | ||
416 | d.GeomSetCollideBits(CharsSpace, 0); | ||
417 | |||
400 | d.GeomSetCategoryBits(StaticSpace, (uint)(CollisionCategories.Space | | 418 | d.GeomSetCategoryBits(StaticSpace, (uint)(CollisionCategories.Space | |
401 | CollisionCategories.Geom | | 419 | CollisionCategories.Geom | |
402 | CollisionCategories.Land | | 420 | // CollisionCategories.Land | |
403 | CollisionCategories.Water | | 421 | // CollisionCategories.Water | |
404 | CollisionCategories.Phantom | | 422 | CollisionCategories.Phantom | |
405 | CollisionCategories.VolumeDtc | 423 | CollisionCategories.VolumeDtc |
406 | )); | 424 | )); |
@@ -1271,6 +1289,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1271 | d.SpaceCollide2(StaticSpace, chr.midbox, IntPtr.Zero, nearCallback); | 1289 | d.SpaceCollide2(StaticSpace, chr.midbox, IntPtr.Zero, nearCallback); |
1272 | d.SpaceCollide2(StaticSpace, chr.feetbox, IntPtr.Zero, nearCallback); | 1290 | d.SpaceCollide2(StaticSpace, chr.feetbox, IntPtr.Zero, nearCallback); |
1273 | d.SpaceCollide2(StaticSpace, chr.bonebox, IntPtr.Zero, nearCallback); | 1291 | d.SpaceCollide2(StaticSpace, chr.bonebox, IntPtr.Zero, nearCallback); |
1292 | |||
1293 | // chars with chars | ||
1294 | d.SpaceCollide(CharsSpace, IntPtr.Zero, nearCallback); | ||
1274 | // no coll with gnd | 1295 | // no coll with gnd |
1275 | } | 1296 | } |
1276 | } | 1297 | } |
@@ -1312,16 +1333,25 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1312 | m_log.Warn("[PHYSICS]: Unable to collide Active prim to static space"); | 1333 | m_log.Warn("[PHYSICS]: Unable to collide Active prim to static space"); |
1313 | } | 1334 | } |
1314 | } | 1335 | } |
1315 | // finally colide active things amoung them | 1336 | // colide active amoung them |
1316 | try | 1337 | try |
1317 | { | 1338 | { |
1318 | d.SpaceCollide(ActiveSpace, IntPtr.Zero, nearCallback); | 1339 | d.SpaceCollide(ActiveSpace, IntPtr.Zero, nearCallback); |
1319 | } | 1340 | } |
1320 | catch (AccessViolationException) | 1341 | catch (AccessViolationException) |
1321 | { | 1342 | { |
1343 | m_log.Warn("[PHYSICS]: Unable to collide Active with Characters space"); | ||
1344 | } | ||
1345 | // and with chars | ||
1346 | try | ||
1347 | { | ||
1348 | d.SpaceCollide2(ActiveSpace, CharsSpace,IntPtr.Zero, nearCallback); | ||
1349 | } | ||
1350 | catch (AccessViolationException) | ||
1351 | { | ||
1322 | m_log.Warn("[PHYSICS]: Unable to collide in Active space"); | 1352 | m_log.Warn("[PHYSICS]: Unable to collide in Active space"); |
1323 | } | 1353 | } |
1324 | // _perloopContact.Clear(); | 1354 | // _perloopContact.Clear(); |
1325 | } | 1355 | } |
1326 | 1356 | ||
1327 | #endregion | 1357 | #endregion |