aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorTeravus Ovares (Dan Olivares)2009-10-10 03:53:53 -0400
committerTeravus Ovares (Dan Olivares)2009-10-10 03:53:53 -0400
commit4ffe936ba837eb47dc235317a54f5fa16af514ce (patch)
tree2b22daaafdef56f6751e30a8cf328c2aee47de51
parent* Fix incorrect math on the Velocity check in PhysicsCollisionUpdate. This ... (diff)
downloadopensim-SC_OLD-4ffe936ba837eb47dc235317a54f5fa16af514ce.zip
opensim-SC_OLD-4ffe936ba837eb47dc235317a54f5fa16af514ce.tar.gz
opensim-SC_OLD-4ffe936ba837eb47dc235317a54f5fa16af514ce.tar.bz2
opensim-SC_OLD-4ffe936ba837eb47dc235317a54f5fa16af514ce.tar.xz
* Make ODECharacter respect the scene's requested collision update time
* Set the Scene collision update time to 500 ms
-rw-r--r--OpenSim/Region/Framework/Scenes/ScenePresence.cs2
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODECharacter.cs15
-rw-r--r--OpenSim/Region/Physics/OdePlugin/OdePlugin.cs1
3 files changed, 15 insertions, 3 deletions
diff --git a/OpenSim/Region/Framework/Scenes/ScenePresence.cs b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
index af85424..e9040e9 100644
--- a/OpenSim/Region/Framework/Scenes/ScenePresence.cs
+++ b/OpenSim/Region/Framework/Scenes/ScenePresence.cs
@@ -3409,7 +3409,7 @@ namespace OpenSim.Region.Framework.Scenes
3409 scene.AddPhysicsActorTaint(m_physicsActor); 3409 scene.AddPhysicsActorTaint(m_physicsActor);
3410 //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients; 3410 //m_physicsActor.OnRequestTerseUpdate += SendTerseUpdateToAllClients;
3411 m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate; 3411 m_physicsActor.OnCollisionUpdate += PhysicsCollisionUpdate;
3412 m_physicsActor.SubscribeEvents(1000); 3412 m_physicsActor.SubscribeEvents(500);
3413 m_physicsActor.LocalID = LocalId; 3413 m_physicsActor.LocalID = LocalId;
3414 3414
3415 } 3415 }
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs
index a00ba11..7a86b6e 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,10 @@ namespace OpenSim.Region.Physics.OdePlugin
1309 } 1315 }
1310 1316
1311 } 1317 }
1318
1319 internal void AddCollisionFrameTime(int p)
1320 {
1321 m_eventsubscription += p;
1322 }
1312 } 1323 }
1313} 1324}
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
index f5ab1de..083b7db 100644
--- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
+++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs
@@ -2928,6 +2928,7 @@ namespace OpenSim.Region.Physics.OdePlugin
2928 { 2928 {
2929 case ActorTypes.Agent: 2929 case ActorTypes.Agent:
2930 OdeCharacter cobj = (OdeCharacter)obj; 2930 OdeCharacter cobj = (OdeCharacter)obj;
2931 cobj.AddCollisionFrameTime(100);
2931 cobj.SendCollisions(); 2932 cobj.SendCollisions();
2932 break; 2933 break;
2933 case ActorTypes.Prim: 2934 case ActorTypes.Prim: