diff options
Diffstat (limited to 'OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs')
-rwxr-xr-x | OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | 14 |
1 files changed, 5 insertions, 9 deletions
diff --git a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs index 34dec26..b8ef338 100755 --- a/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs +++ b/OpenSim/Region/Physics/BulletSPlugin/BSPhysObject.cs | |||
@@ -141,18 +141,15 @@ public abstract class BSPhysObject : PhysicsActor | |||
141 | // if someone has subscribed for collision events.... | 141 | // if someone has subscribed for collision events.... |
142 | if (SubscribedEvents()) { | 142 | if (SubscribedEvents()) { |
143 | CollisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); | 143 | CollisionCollection.AddCollider(collidingWith, new ContactPoint(contactPoint, contactNormal, pentrationDepth)); |
144 | // DetailLog("{0},{1}.Collison.AddCollider,call,with={2},point={3},normal={4},depth={5}", | 144 | DetailLog("{0},{1}.Collison.AddCollider,call,with={2},point={3},normal={4},depth={5}", |
145 | // LocalID, TypeName, collidingWith, contactPoint, contactNormal, pentrationDepth); | 145 | LocalID, TypeName, collidingWith, contactPoint, contactNormal, pentrationDepth); |
146 | 146 | ||
147 | ret = true; | 147 | ret = true; |
148 | } | 148 | } |
149 | return ret; | 149 | return ret; |
150 | } | 150 | } |
151 | 151 | ||
152 | // Routine to send the collected collisions into the simulator. | 152 | // Send the collected collisions into the simulator. |
153 | // Also handles removal of this from the collection of objects with collisions if | ||
154 | // there are no collisions from this object. Mechanism is create one last | ||
155 | // collision event to make collision_end work. | ||
156 | // Called at taint time from within the Step() function thus no locking problems | 153 | // Called at taint time from within the Step() function thus no locking problems |
157 | // with CollisionCollection and ObjectsWithNoMoreCollisions. | 154 | // with CollisionCollection and ObjectsWithNoMoreCollisions. |
158 | // Return 'true' if there were some actual collisions passed up | 155 | // Return 'true' if there were some actual collisions passed up |
@@ -161,10 +158,9 @@ public abstract class BSPhysObject : PhysicsActor | |||
161 | bool ret = true; | 158 | bool ret = true; |
162 | 159 | ||
163 | // throttle the collisions to the number of milliseconds specified in the subscription | 160 | // throttle the collisions to the number of milliseconds specified in the subscription |
164 | int nowTime = PhysicsScene.SimulationNowTime; | 161 | if (PhysicsScene.SimulationNowTime >= NextCollisionOkTime) |
165 | if (nowTime >= NextCollisionOkTime) | ||
166 | { | 162 | { |
167 | NextCollisionOkTime = nowTime + SubscribedEventsMs; | 163 | NextCollisionOkTime = PhysicsScene.SimulationNowTime + SubscribedEventsMs; |
168 | 164 | ||
169 | // We are called if we previously had collisions. If there are no collisions | 165 | // We are called if we previously had collisions. If there are no collisions |
170 | // this time, send up one last empty event so OpenSim can sense collision end. | 166 | // this time, send up one last empty event so OpenSim can sense collision end. |