diff options
Diffstat (limited to '')
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 23 |
1 files changed, 22 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 889afb6..87357a3 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -306,6 +306,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
306 | 306 | ||
307 | private volatile int m_global_contactcount = 0; | 307 | private volatile int m_global_contactcount = 0; |
308 | 308 | ||
309 | private ODERayCastRequestManager m_rayCastManager; | ||
310 | |||
309 | /// <summary> | 311 | /// <summary> |
310 | /// Initiailizes the scene | 312 | /// Initiailizes the scene |
311 | /// Sets many properties that ODE requires to be stable | 313 | /// Sets many properties that ODE requires to be stable |
@@ -321,7 +323,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
321 | nearCallback = near; | 323 | nearCallback = near; |
322 | triCallback = TriCallback; | 324 | triCallback = TriCallback; |
323 | triArrayCallback = TriArrayCallback; | 325 | triArrayCallback = TriArrayCallback; |
324 | 326 | m_rayCastManager = new ODERayCastRequestManager(this); | |
325 | lock (OdeLock) | 327 | lock (OdeLock) |
326 | { | 328 | { |
327 | // Create the world and the first space | 329 | // Create the world and the first space |
@@ -2833,6 +2835,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
2833 | //if ((framecount % m_randomizeWater) == 0) | 2835 | //if ((framecount % m_randomizeWater) == 0) |
2834 | // randomizeWater(waterlevel); | 2836 | // randomizeWater(waterlevel); |
2835 | 2837 | ||
2838 | int RayCastTimeMS = m_rayCastManager.ProcessQueuedRequests(); | ||
2839 | |||
2836 | collision_optimized(timeStep); | 2840 | collision_optimized(timeStep); |
2837 | 2841 | ||
2838 | lock (_collisionEventPrim) | 2842 | lock (_collisionEventPrim) |
@@ -3377,6 +3381,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3377 | 3381 | ||
3378 | public override void Dispose() | 3382 | public override void Dispose() |
3379 | { | 3383 | { |
3384 | m_rayCastManager.Dispose(); | ||
3385 | m_rayCastManager = null; | ||
3386 | |||
3380 | lock (OdeLock) | 3387 | lock (OdeLock) |
3381 | { | 3388 | { |
3382 | lock (_prims) | 3389 | lock (_prims) |
@@ -3417,6 +3424,20 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
3417 | } | 3424 | } |
3418 | return returncolliders; | 3425 | return returncolliders; |
3419 | } | 3426 | } |
3427 | |||
3428 | public override bool SupportsRayCast() | ||
3429 | { | ||
3430 | return true; | ||
3431 | } | ||
3432 | |||
3433 | public override void RaycastWorld(Vector3 position, Vector3 direction, float length, RaycastCallback retMethod) | ||
3434 | { | ||
3435 | if (retMethod != null) | ||
3436 | { | ||
3437 | m_rayCastManager.QueueRequest(position, direction, length, retMethod); | ||
3438 | } | ||
3439 | } | ||
3440 | |||
3420 | #if USE_DRAWSTUFF | 3441 | #if USE_DRAWSTUFF |
3421 | // Keyboard callback | 3442 | // Keyboard callback |
3422 | public void command(int cmd) | 3443 | public void command(int cmd) |