diff options
author | UbitUmarov | 2016-08-06 02:05:23 +0100 |
---|---|---|
committer | UbitUmarov | 2016-08-06 02:05:23 +0100 |
commit | 17cc238b443adbdddf45db4a1a023d0b564ac860 (patch) | |
tree | c579babba10b8a1c431929f9b17bb11cf913ee23 /OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | |
parent | fix osGetHealRate thread level (diff) | |
download | opensim-SC-17cc238b443adbdddf45db4a1a023d0b564ac860.zip opensim-SC-17cc238b443adbdddf45db4a1a023d0b564ac860.tar.gz opensim-SC-17cc238b443adbdddf45db4a1a023d0b564ac860.tar.bz2 opensim-SC-17cc238b443adbdddf45db4a1a023d0b564ac860.tar.xz |
ubOde a few changes to collisions reporting
Diffstat (limited to 'OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs')
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | 38 |
1 files changed, 27 insertions, 11 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs index ebaa875..9f62644 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs | |||
@@ -65,7 +65,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
65 | internal bool m_isVolumeDetect; // If true, this prim only detects collisions but doesn't collide actively | 65 | internal bool m_isVolumeDetect; // If true, this prim only detects collisions but doesn't collide actively |
66 | private bool m_fakeisVolumeDetect; // If true, this prim only detects collisions but doesn't collide actively | 66 | private bool m_fakeisVolumeDetect; // If true, this prim only detects collisions but doesn't collide actively |
67 | 67 | ||
68 | protected bool m_building; | 68 | internal bool m_building; |
69 | protected bool m_forcePosOrRotation; | 69 | protected bool m_forcePosOrRotation; |
70 | private bool m_iscolliding; | 70 | private bool m_iscolliding; |
71 | 71 | ||
@@ -1000,14 +1000,36 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1000 | 1000 | ||
1001 | public override void AddCollisionEvent(uint CollidedWith, ContactPoint contact) | 1001 | public override void AddCollisionEvent(uint CollidedWith, ContactPoint contact) |
1002 | { | 1002 | { |
1003 | |||
1003 | if (CollisionEventsThisFrame == null) | 1004 | if (CollisionEventsThisFrame == null) |
1004 | CollisionEventsThisFrame = new CollisionEventUpdate(); | 1005 | CollisionEventsThisFrame = new CollisionEventUpdate(); |
1005 | // if(CollisionEventsThisFrame.Count < 32) | 1006 | CollisionEventsThisFrame.AddCollider(CollidedWith, contact); |
1006 | CollisionEventsThisFrame.AddCollider(CollidedWith, contact); | 1007 | _parent_scene.AddCollisionEventReporting(this); |
1008 | } | ||
1009 | |||
1010 | internal void SleeperAddCollisionEvents() | ||
1011 | { | ||
1012 | if (CollisionEventsThisFrame == null) | ||
1013 | return; | ||
1014 | if(CollisionEventsThisFrame.m_objCollisionList.Count == 0) | ||
1015 | return; | ||
1016 | foreach(KeyValuePair<uint,ContactPoint> kvp in CollisionEventsThisFrame.m_objCollisionList) | ||
1017 | { | ||
1018 | OdePrim other = _parent_scene.getPrim(kvp.Key); | ||
1019 | if(other == null) | ||
1020 | continue; | ||
1021 | ContactPoint cp = kvp.Value; | ||
1022 | cp.SurfaceNormal = - cp.SurfaceNormal; | ||
1023 | cp.RelativeSpeed = -cp.RelativeSpeed; | ||
1024 | other.AddCollisionEvent(ParentActor.LocalID,cp); | ||
1025 | } | ||
1007 | } | 1026 | } |
1008 | 1027 | ||
1009 | public void SendCollisions() | 1028 | public void SendCollisions(int timestep) |
1010 | { | 1029 | { |
1030 | if (m_cureventsubscription < 50000) | ||
1031 | m_cureventsubscription += timestep; | ||
1032 | |||
1011 | if (CollisionEventsThisFrame == null) | 1033 | if (CollisionEventsThisFrame == null) |
1012 | return; | 1034 | return; |
1013 | 1035 | ||
@@ -1027,7 +1049,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1027 | SentEmptyCollisionsEvent = true; | 1049 | SentEmptyCollisionsEvent = true; |
1028 | _parent_scene.RemoveCollisionEventReporting(this); | 1050 | _parent_scene.RemoveCollisionEventReporting(this); |
1029 | } | 1051 | } |
1030 | else | 1052 | else if(Body == IntPtr.Zero || d.BodyIsEnabled(Body)) |
1031 | { | 1053 | { |
1032 | SentEmptyCollisionsEvent = false; | 1054 | SentEmptyCollisionsEvent = false; |
1033 | CollisionEventsThisFrame.Clear(); | 1055 | CollisionEventsThisFrame.Clear(); |
@@ -1035,12 +1057,6 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1035 | } | 1057 | } |
1036 | } | 1058 | } |
1037 | 1059 | ||
1038 | internal void AddCollisionFrameTime(int t) | ||
1039 | { | ||
1040 | if (m_cureventsubscription < 50000) | ||
1041 | m_cureventsubscription += t; | ||
1042 | } | ||
1043 | |||
1044 | public override bool SubscribedEvents() | 1060 | public override bool SubscribedEvents() |
1045 | { | 1061 | { |
1046 | if (m_eventsubscription > 0) | 1062 | if (m_eventsubscription > 0) |