diff options
author | UbitUmarov | 2018-12-11 17:23:55 +0000 |
---|---|---|
committer | UbitUmarov | 2018-12-11 17:23:55 +0000 |
commit | af2a9d9508e08f1493858c27ad90f682b58e1ae4 (patch) | |
tree | 09de59564c144abdcd6f430a205a7309be0fb09a /OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | |
parent | Return a fake openid token to enable web services on a grid to identify the user (diff) | |
download | opensim-SC-af2a9d9508e08f1493858c27ad90f682b58e1ae4.zip opensim-SC-af2a9d9508e08f1493858c27ad90f682b58e1ae4.tar.gz opensim-SC-af2a9d9508e08f1493858c27ad90f682b58e1ae4.tar.bz2 opensim-SC-af2a9d9508e08f1493858c27ad90f682b58e1ae4.tar.xz |
mantis 8420: ubOde awake up lazy body
Diffstat (limited to 'OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs')
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 62 |
1 files changed, 9 insertions, 53 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index 567de23..c231787 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | |||
@@ -288,10 +288,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
288 | 288 | ||
289 | public IConfigSource m_config; | 289 | public IConfigSource m_config; |
290 | 290 | ||
291 | public bool physics_logging = false; | ||
292 | public int physics_logging_interval = 0; | ||
293 | public bool physics_logging_append_existing_logfile = false; | ||
294 | |||
295 | public Vector2 WorldExtents = new Vector2((int)Constants.RegionSize, (int)Constants.RegionSize); | 291 | public Vector2 WorldExtents = new Vector2((int)Constants.RegionSize, (int)Constants.RegionSize); |
296 | 292 | ||
297 | private ODERayCastRequestManager m_rayCastManager; | 293 | private ODERayCastRequestManager m_rayCastManager; |
@@ -469,10 +465,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
469 | geomDefaultDensity = physicsconfig.GetFloat("geometry_default_density", geomDefaultDensity); | 465 | geomDefaultDensity = physicsconfig.GetFloat("geometry_default_density", geomDefaultDensity); |
470 | // bodyFramesAutoDisable = physicsconfig.GetInt("body_frames_auto_disable", bodyFramesAutoDisable); | 466 | // bodyFramesAutoDisable = physicsconfig.GetInt("body_frames_auto_disable", bodyFramesAutoDisable); |
471 | 467 | ||
472 | physics_logging = physicsconfig.GetBoolean("physics_logging", false); | ||
473 | physics_logging_interval = physicsconfig.GetInt("physics_logging_interval", 0); | ||
474 | physics_logging_append_existing_logfile = physicsconfig.GetBoolean("physics_logging_append_existing_logfile", false); | ||
475 | |||
476 | minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", minimumGroundFlightOffset); | 468 | minimumGroundFlightOffset = physicsconfig.GetFloat("minimum_ground_flight_offset", minimumGroundFlightOffset); |
477 | maximumMassObject = physicsconfig.GetFloat("maximum_mass_object", maximumMassObject); | 469 | maximumMassObject = physicsconfig.GetFloat("maximum_mass_object", maximumMassObject); |
478 | 470 | ||
@@ -633,51 +625,15 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
633 | return; | 625 | return; |
634 | } | 626 | } |
635 | 627 | ||
636 | // get geom bodies to check if we already a joint contact | ||
637 | // guess this shouldn't happen now | ||
638 | IntPtr b1 = SafeNativeMethods.GeomGetBody(g1); | ||
639 | IntPtr b2 = SafeNativeMethods.GeomGetBody(g2); | ||
640 | 628 | ||
641 | // d.GeomClassID id = d.GeomGetClass(g1); | ||
642 | 629 | ||
643 | // Figure out how many contact points we have | 630 | // Figure out how many contact points we have |
644 | int count = 0; | 631 | int count = 0; |
645 | try | 632 | try |
646 | { | 633 | { |
647 | // Colliding Geom To Geom | ||
648 | // This portion of the function 'was' blatantly ripped off from BoxStack.cs | ||
649 | |||
650 | if (g1 == g2) | 634 | if (g1 == g2) |
651 | return; // Can't collide with yourself | 635 | return; // Can't collide with yourself |
652 | 636 | ||
653 | // if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnectedExcluding(b1, b2, d.JointType.Contact)) | ||
654 | // return; | ||
655 | /* | ||
656 | // debug | ||
657 | PhysicsActor dp2; | ||
658 | if (d.GeomGetClass(g1) == d.GeomClassID.HeightfieldClass) | ||
659 | { | ||
660 | d.AABB aabb; | ||
661 | d.GeomGetAABB(g2, out aabb); | ||
662 | float x = aabb.MaxX - aabb.MinX; | ||
663 | float y = aabb.MaxY - aabb.MinY; | ||
664 | float z = aabb.MaxZ - aabb.MinZ; | ||
665 | if (x > 60.0f || y > 60.0f || z > 60.0f) | ||
666 | { | ||
667 | if (!actor_name_map.TryGetValue(g2, out dp2)) | ||
668 | m_log.WarnFormat("[PHYSICS]: failed actor mapping for geom 2"); | ||
669 | else | ||
670 | m_log.WarnFormat("[PHYSICS]: land versus large prim geo {0},size {1}, AABBsize <{2},{3},{4}>, at {5} ori {6},({7})", | ||
671 | dp2.Name, dp2.Size, x, y, z, | ||
672 | dp2.Position.ToString(), | ||
673 | dp2.Orientation.ToString(), | ||
674 | dp2.Orientation.Length()); | ||
675 | return; | ||
676 | } | ||
677 | } | ||
678 | // | ||
679 | */ | ||
680 | |||
681 | if (SafeNativeMethods.GeomGetCategoryBits(g1) == (uint)CollisionCategories.VolumeDtc || | 637 | if (SafeNativeMethods.GeomGetCategoryBits(g1) == (uint)CollisionCategories.VolumeDtc || |
682 | SafeNativeMethods.GeomGetCategoryBits(g2) == (uint)CollisionCategories.VolumeDtc) | 638 | SafeNativeMethods.GeomGetCategoryBits(g2) == (uint)CollisionCategories.VolumeDtc) |
683 | { | 639 | { |
@@ -707,29 +663,26 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
707 | if (count == 0) | 663 | if (count == 0) |
708 | return; | 664 | return; |
709 | 665 | ||
666 | // get first contact | ||
667 | SafeNativeMethods.ContactGeom curContact = new SafeNativeMethods.ContactGeom(); | ||
668 | if (!GetCurContactGeom(0, ref curContact)) | ||
669 | return; | ||
670 | |||
710 | // try get physical actors | 671 | // try get physical actors |
711 | PhysicsActor p1; | 672 | PhysicsActor p1; |
712 | PhysicsActor p2; | ||
713 | |||
714 | if (!actor_name_map.TryGetValue(g1, out p1)) | 673 | if (!actor_name_map.TryGetValue(g1, out p1)) |
715 | { | 674 | { |
716 | m_log.WarnFormat("[PHYSICS]: failed actor mapping for geom 1"); | 675 | m_log.WarnFormat("[PHYSICS]: failed actor mapping for geom 1"); |
717 | return; | 676 | return; |
718 | } | 677 | } |
719 | 678 | ||
679 | PhysicsActor p2; | ||
720 | if (!actor_name_map.TryGetValue(g2, out p2)) | 680 | if (!actor_name_map.TryGetValue(g2, out p2)) |
721 | { | 681 | { |
722 | m_log.WarnFormat("[PHYSICS]: failed actor mapping for geom 2"); | 682 | m_log.WarnFormat("[PHYSICS]: failed actor mapping for geom 2"); |
723 | return; | 683 | return; |
724 | } | 684 | } |
725 | 685 | ||
726 | |||
727 | // get first contact | ||
728 | SafeNativeMethods.ContactGeom curContact = new SafeNativeMethods.ContactGeom(); | ||
729 | |||
730 | if (!GetCurContactGeom(0, ref curContact)) | ||
731 | return; | ||
732 | |||
733 | ContactPoint maxDepthContact = new ContactPoint(); | 686 | ContactPoint maxDepthContact = new ContactPoint(); |
734 | 687 | ||
735 | // do volume detection case | 688 | // do volume detection case |
@@ -879,6 +832,9 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
879 | if(dop1ava || dop2ava) | 832 | if(dop1ava || dop2ava) |
880 | smoothMesh = false; | 833 | smoothMesh = false; |
881 | 834 | ||
835 | IntPtr b1 = SafeNativeMethods.GeomGetBody(g1); | ||
836 | IntPtr b2 = SafeNativeMethods.GeomGetBody(g2); | ||
837 | |||
882 | while (true) | 838 | while (true) |
883 | { | 839 | { |
884 | noskip = true; | 840 | noskip = true; |