diff options
author | Melanie | 2009-10-12 15:11:01 +0100 |
---|---|---|
committer | Melanie | 2009-10-12 15:11:01 +0100 |
commit | 50f509d600dd0fe172d5c026a42e229fbcdc3fcd (patch) | |
tree | 847569e552590333b2d1cb837705050c029cd797 /OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |
parent | Merge branch 'master' into vehicles (diff) | |
parent | Fix selling objects (diff) | |
download | opensim-SC-50f509d600dd0fe172d5c026a42e229fbcdc3fcd.zip opensim-SC-50f509d600dd0fe172d5c026a42e229fbcdc3fcd.tar.gz opensim-SC-50f509d600dd0fe172d5c026a42e229fbcdc3fcd.tar.bz2 opensim-SC-50f509d600dd0fe172d5c026a42e229fbcdc3fcd.tar.xz |
Merge branch 'master' into vehicles
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODECharacter.cs')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index a00ba11..bd81d50 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -98,6 +98,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
98 | private bool m_alwaysRun = false; | 98 | private bool m_alwaysRun = false; |
99 | private bool m_hackSentFall = false; | 99 | private bool m_hackSentFall = false; |
100 | private bool m_hackSentFly = false; | 100 | private bool m_hackSentFly = false; |
101 | private int m_requestedUpdateFrequency = 0; | ||
101 | private PhysicsVector m_taintPosition = new PhysicsVector(0, 0, 0); | 102 | private PhysicsVector m_taintPosition = new PhysicsVector(0, 0, 0); |
102 | public uint m_localID = 0; | 103 | public uint m_localID = 0; |
103 | public bool m_returnCollisions = false; | 104 | public bool m_returnCollisions = false; |
@@ -1184,26 +1185,31 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1184 | 1185 | ||
1185 | public override void SubscribeEvents(int ms) | 1186 | public override void SubscribeEvents(int ms) |
1186 | { | 1187 | { |
1188 | m_requestedUpdateFrequency = ms; | ||
1187 | m_eventsubscription = ms; | 1189 | m_eventsubscription = ms; |
1188 | _parent_scene.addCollisionEventReporting(this); | 1190 | _parent_scene.addCollisionEventReporting(this); |
1189 | } | 1191 | } |
1190 | public override void UnSubscribeEvents() | 1192 | public override void UnSubscribeEvents() |
1191 | { | 1193 | { |
1192 | _parent_scene.remCollisionEventReporting(this); | 1194 | _parent_scene.remCollisionEventReporting(this); |
1195 | m_requestedUpdateFrequency = 0; | ||
1193 | m_eventsubscription = 0; | 1196 | m_eventsubscription = 0; |
1194 | } | 1197 | } |
1195 | public void AddCollisionEvent(uint CollidedWith, float depth) | 1198 | public void AddCollisionEvent(uint CollidedWith, float depth) |
1196 | { | 1199 | { |
1197 | if (m_eventsubscription > 0) | 1200 | if (m_eventsubscription > 0) |
1198 | CollisionEventsThisFrame.addCollider(CollidedWith,depth); | 1201 | { |
1202 | CollisionEventsThisFrame.addCollider(CollidedWith, depth); | ||
1203 | } | ||
1199 | } | 1204 | } |
1200 | 1205 | ||
1201 | public void SendCollisions() | 1206 | public void SendCollisions() |
1202 | { | 1207 | { |
1203 | if (m_eventsubscription > 0) | 1208 | if (m_eventsubscription > m_requestedUpdateFrequency) |
1204 | { | 1209 | { |
1205 | base.SendCollisionUpdate(CollisionEventsThisFrame); | 1210 | base.SendCollisionUpdate(CollisionEventsThisFrame); |
1206 | CollisionEventsThisFrame = new CollisionEventUpdate(); | 1211 | CollisionEventsThisFrame = new CollisionEventUpdate(); |
1212 | m_eventsubscription = 0; | ||
1207 | } | 1213 | } |
1208 | } | 1214 | } |
1209 | public override bool SubscribedEvents() | 1215 | public override bool SubscribedEvents() |
@@ -1309,5 +1315,13 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1309 | } | 1315 | } |
1310 | 1316 | ||
1311 | } | 1317 | } |
1318 | |||
1319 | internal void AddCollisionFrameTime(int p) | ||
1320 | { | ||
1321 | // protect it from overflow crashing | ||
1322 | if (m_eventsubscription + p >= int.MaxValue) | ||
1323 | m_eventsubscription = 0; | ||
1324 | m_eventsubscription += p; | ||
1325 | } | ||
1312 | } | 1326 | } |
1313 | } | 1327 | } |