aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim
diff options
context:
space:
mode:
authorUbitUmarov2017-07-07 01:49:34 +0100
committerUbitUmarov2017-07-07 01:49:34 +0100
commitdfef16297b51fb81550745aeea05bd10cb1fc766 (patch)
tree7bf32f09bb1b1a2dda3660a27c6a0c2016c39840 /OpenSim
parentubOde: but only do that if sphere is physical.. (diff)
downloadopensim-SC-dfef16297b51fb81550745aeea05bd10cb1fc766.zip
opensim-SC-dfef16297b51fb81550745aeea05bd10cb1fc766.tar.gz
opensim-SC-dfef16297b51fb81550745aeea05bd10cb1fc766.tar.bz2
opensim-SC-dfef16297b51fb81550745aeea05bd10cb1fc766.tar.xz
ubOde don't use old ode body sleep option, a few changes on sleep control, update ode.dll (windows, others needed) (keep older versions.. bc.. well bugs happen)
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs1
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs36
-rw-r--r--OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs2
3 files changed, 31 insertions, 8 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs
index 2e6a7db..ce10065 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEDynamics.cs
@@ -345,6 +345,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
345 if (rootPrim.Body != IntPtr.Zero && !d.BodyIsEnabled(rootPrim.Body) 345 if (rootPrim.Body != IntPtr.Zero && !d.BodyIsEnabled(rootPrim.Body)
346 && !rootPrim.m_isSelected && !rootPrim.m_disabled) 346 && !rootPrim.m_isSelected && !rootPrim.m_disabled)
347 d.BodyEnable(rootPrim.Body); 347 d.BodyEnable(rootPrim.Body);
348
348 break; 349 break;
349 case Vehicle.LINEAR_FRICTION_TIMESCALE: 350 case Vehicle.LINEAR_FRICTION_TIMESCALE:
350 if (pValue < m_timestep) pValue = m_timestep; 351 if (pValue < m_timestep) pValue = m_timestep;
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
index 4bed0d2..005caee 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEPrim.cs
@@ -1847,8 +1847,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde
1847 ApplyCollisionCatFlags(); 1847 ApplyCollisionCatFlags();
1848 1848
1849 _zeroFlag = true; 1849 _zeroFlag = true;
1850 d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
1850 d.BodyEnable(Body); 1851 d.BodyEnable(Body);
1851
1852 } 1852 }
1853 } 1853 }
1854 resetCollisionAccounting(); 1854 resetCollisionAccounting();
@@ -2900,6 +2900,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
2900 if (Body != IntPtr.Zero && !m_disabled) 2900 if (Body != IntPtr.Zero && !m_disabled)
2901 { 2901 {
2902 _zeroFlag = true; 2902 _zeroFlag = true;
2903 d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
2903 d.BodyEnable(Body); 2904 d.BodyEnable(Body);
2904 } 2905 }
2905 } 2906 }
@@ -2933,6 +2934,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
2933 if (!d.BodyIsEnabled(Body)) 2934 if (!d.BodyIsEnabled(Body))
2934 { 2935 {
2935 _zeroFlag = true; 2936 _zeroFlag = true;
2937 d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
2936 d.BodyEnable(Body); 2938 d.BodyEnable(Body);
2937 } 2939 }
2938 } 2940 }
@@ -2947,6 +2949,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
2947 if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body)) 2949 if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
2948 { 2950 {
2949 _zeroFlag = true; 2951 _zeroFlag = true;
2952 d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
2950 d.BodyEnable(Body); 2953 d.BodyEnable(Body);
2951 } 2954 }
2952 } 2955 }
@@ -3012,6 +3015,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
3012 if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body)) 3015 if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
3013 { 3016 {
3014 _zeroFlag = true; 3017 _zeroFlag = true;
3018 d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
3015 d.BodyEnable(Body); 3019 d.BodyEnable(Body);
3016 } 3020 }
3017 } 3021 }
@@ -3070,6 +3074,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
3070 if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body)) 3074 if (Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
3071 { 3075 {
3072 _zeroFlag = true; 3076 _zeroFlag = true;
3077 d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
3073 d.BodyEnable(Body); 3078 d.BodyEnable(Body);
3074 } 3079 }
3075 } 3080 }
@@ -3312,8 +3317,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde
3312 if (m_disabled) 3317 if (m_disabled)
3313 enableBodySoft(); 3318 enableBodySoft();
3314 else if (!d.BodyIsEnabled(Body)) 3319 else if (!d.BodyIsEnabled(Body))
3320 {
3321 d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
3315 d.BodyEnable(Body); 3322 d.BodyEnable(Body);
3316 3323 }
3317 } 3324 }
3318 m_torque = newtorque; 3325 m_torque = newtorque;
3319 } 3326 }
@@ -3323,7 +3330,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde
3323 { 3330 {
3324 m_force = force; 3331 m_force = force;
3325 if (!m_isSelected && !m_outbounds && Body != IntPtr.Zero && !d.BodyIsEnabled(Body)) 3332 if (!m_isSelected && !m_outbounds && Body != IntPtr.Zero && !d.BodyIsEnabled(Body))
3333 {
3334 d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
3326 d.BodyEnable(Body); 3335 d.BodyEnable(Body);
3336 }
3327 } 3337 }
3328 3338
3329 private void changeAddForce(Vector3 theforce) 3339 private void changeAddForce(Vector3 theforce)
@@ -3339,7 +3349,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde
3339 if (m_disabled) 3349 if (m_disabled)
3340 enableBodySoft(); 3350 enableBodySoft();
3341 else if (!d.BodyIsEnabled(Body)) 3351 else if (!d.BodyIsEnabled(Body))
3352 {
3353 d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
3342 d.BodyEnable(Body); 3354 d.BodyEnable(Body);
3355 }
3343 } 3356 }
3344 } 3357 }
3345 m_collisionscore = 0; 3358 m_collisionscore = 0;
@@ -3359,7 +3372,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde
3359 if (m_disabled) 3372 if (m_disabled)
3360 enableBodySoft(); 3373 enableBodySoft();
3361 else if (!d.BodyIsEnabled(Body)) 3374 else if (!d.BodyIsEnabled(Body))
3375 {
3376 d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
3362 d.BodyEnable(Body); 3377 d.BodyEnable(Body);
3378 }
3363 } 3379 }
3364 } 3380 }
3365 m_collisionscore = 0; 3381 m_collisionscore = 0;
@@ -3382,7 +3398,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde
3382 if (m_disabled) 3398 if (m_disabled)
3383 enableBodySoft(); 3399 enableBodySoft();
3384 else if (!d.BodyIsEnabled(Body)) 3400 else if (!d.BodyIsEnabled(Body))
3401 {
3402 d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
3385 d.BodyEnable(Body); 3403 d.BodyEnable(Body);
3404 }
3386 d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z); 3405 d.BodySetLinearVel(Body, newVel.X, newVel.Y, newVel.Z);
3387 } 3406 }
3388 //resetCollisionAccounting(); 3407 //resetCollisionAccounting();
@@ -3406,7 +3425,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde
3406 if (m_disabled) 3425 if (m_disabled)
3407 enableBodySoft(); 3426 enableBodySoft();
3408 else if (!d.BodyIsEnabled(Body)) 3427 else if (!d.BodyIsEnabled(Body))
3428 {
3429 d.BodySetAutoDisableSteps(Body, m_body_autodisable_frames);
3409 d.BodyEnable(Body); 3430 d.BodyEnable(Body);
3431 }
3410 d.BodySetAngularVel(Body, newAngVel.X, newAngVel.Y, newAngVel.Z); 3432 d.BodySetAngularVel(Body, newAngVel.X, newAngVel.Y, newAngVel.Z);
3411 } 3433 }
3412 //resetCollisionAccounting(); 3434 //resetCollisionAccounting();
@@ -3571,12 +3593,13 @@ namespace OpenSim.Region.PhysicsModule.ubOde
3571 d.BodySetAngularVel(Body,0f,0f,0f); 3593 d.BodySetAngularVel(Body,0f,0f,0f);
3572 d.BodySetLinearVel(Body,0f,0f,0f); 3594 d.BodySetLinearVel(Body,0f,0f,0f);
3573 _zeroFlag = true; 3595 _zeroFlag = true;
3596 d.BodySetAutoDisableSteps(Body, 1);
3574 d.BodyEnable(Body); 3597 d.BodyEnable(Body);
3575 m_bodydisablecontrol = -4; 3598 m_bodydisablecontrol = -4;
3576 } 3599 }
3577 3600
3578 if(m_bodydisablecontrol < 0) 3601 if(m_bodydisablecontrol < 0)
3579 m_bodydisablecontrol ++; 3602 m_bodydisablecontrol++;
3580 3603
3581 d.Vector3 lpos = d.GeomGetPosition(prim_geom); // root position that is seem by rest of simulator 3604 d.Vector3 lpos = d.GeomGetPosition(prim_geom); // root position that is seem by rest of simulator
3582 3605
@@ -3741,13 +3764,12 @@ namespace OpenSim.Region.PhysicsModule.ubOde
3741 3764
3742 public void UpdatePositionAndVelocity(int frame) 3765 public void UpdatePositionAndVelocity(int frame)
3743 { 3766 {
3744 if (_parent == null && !m_disabled && !m_building && !m_outbounds && Body != IntPtr.Zero) 3767 if (_parent == null && !m_isSelected && !m_disabled && !m_building && !m_outbounds && Body != IntPtr.Zero)
3745 { 3768 {
3746 bool bodyenabled = d.BodyIsEnabled(Body);
3747
3748 if(m_bodydisablecontrol < 0) 3769 if(m_bodydisablecontrol < 0)
3749 return; 3770 return;
3750 3771
3772 bool bodyenabled = d.BodyIsEnabled(Body);
3751 if (bodyenabled || !_zeroFlag) 3773 if (bodyenabled || !_zeroFlag)
3752 { 3774 {
3753 bool lastZeroFlag = _zeroFlag; 3775 bool lastZeroFlag = _zeroFlag;
@@ -3891,7 +3913,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
3891 // disable interpolators 3913 // disable interpolators
3892 _velocity = Vector3.Zero; 3914 _velocity = Vector3.Zero;
3893 m_acceleration = Vector3.Zero; 3915 m_acceleration = Vector3.Zero;
3894 m_rotationalVelocity = Vector3.Zero; 3916 m_rotationalVelocity = Vector3.Zero;
3895 } 3917 }
3896 else 3918 else
3897 { 3919 {
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
index 844d02b..5758e0a 100644
--- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
+++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs
@@ -481,7 +481,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde
481 contactsPerCollision = physicsconfig.GetInt("contacts_per_collision", contactsPerCollision); 481 contactsPerCollision = physicsconfig.GetInt("contacts_per_collision", contactsPerCollision);
482 482
483 geomDefaultDensity = physicsconfig.GetFloat("geometry_default_density", geomDefaultDensity); 483 geomDefaultDensity = physicsconfig.GetFloat("geometry_default_density", geomDefaultDensity);
484 bodyFramesAutoDisable = physicsconfig.GetInt("body_frames_auto_disable", bodyFramesAutoDisable); 484// bodyFramesAutoDisable = physicsconfig.GetInt("body_frames_auto_disable", bodyFramesAutoDisable);
485 485
486 physics_logging = physicsconfig.GetBoolean("physics_logging", false); 486 physics_logging = physicsconfig.GetBoolean("physics_logging", false);
487 physics_logging_interval = physicsconfig.GetInt("physics_logging_interval", 0); 487 physics_logging_interval = physicsconfig.GetInt("physics_logging_interval", 0);