aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorUbitUmarov2012-04-29 11:46:16 +0100
committerUbitUmarov2012-04-29 11:46:16 +0100
commit303739622cc9b0f173d9ff88211f28c7295e8c65 (patch)
treee4f64b18d571a1a1e87c251253900a90158b38bd
parentubitode fix inertia for same cases. Added a nasty lock on llGetCenterOfMass a... (diff)
downloadopensim-SC_OLD-303739622cc9b0f173d9ff88211f28c7295e8c65.zip
opensim-SC_OLD-303739622cc9b0f173d9ff88211f28c7295e8c65.tar.gz
opensim-SC_OLD-303739622cc9b0f173d9ff88211f28c7295e8c65.tar.bz2
opensim-SC_OLD-303739622cc9b0f173d9ff88211f28c7295e8c65.tar.xz
ubitODE fix applyROtationImpulse, let vehicle hover be relative to root prim and not center of mass ( as SL docs said) updated some flags to current ones
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs43
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs4
2 files changed, 32 insertions, 15 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs
index d106677..7b232c1 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs
@@ -470,15 +470,20 @@ namespace OpenSim.Region.Physics.OdePlugin
470 m_linearDeflectionEfficiency = 1; 470 m_linearDeflectionEfficiency = 1;
471 m_linearDeflectionTimescale = 1; 471 m_linearDeflectionTimescale = 1;
472 m_angularDeflectionEfficiency = 0; 472 m_angularDeflectionEfficiency = 0;
473 m_angularDeflectionTimescale = 1000; 473 m_angularDeflectionTimescale = 10;
474 m_verticalAttractionEfficiency = 1;
475 m_verticalAttractionTimescale = 1000;
474 m_bankingEfficiency = 0; 476 m_bankingEfficiency = 0;
475 m_bankingMix = 1; 477 m_bankingMix = 1;
476 m_bankingTimescale = 10; 478 m_bankingTimescale = 10;
477 m_flags &= 479 m_flags &=
478 ~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | 480 ~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY |
479 VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY); 481 VehicleFlag.HOVER_GLOBAL_HEIGHT | VehicleFlag.HOVER_UP_ONLY);
480 m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.LIMIT_ROLL_ONLY | VehicleFlag.LIMIT_MOTOR_UP); 482 m_flags |= (VehicleFlag.NO_DEFLECTION_UP |
483 VehicleFlag.LIMIT_ROLL_ONLY |
484 VehicleFlag.LIMIT_MOTOR_UP);
481 break; 485 break;
486
482 case Vehicle.TYPE_CAR: 487 case Vehicle.TYPE_CAR:
483 m_linearFrictionTimescale = new Vector3(100, 2, 1000); 488 m_linearFrictionTimescale = new Vector3(100, 2, 1000);
484 m_angularFrictionTimescale = new Vector3(1000, 1000, 1000); 489 m_angularFrictionTimescale = new Vector3(1000, 1000, 1000);
@@ -499,9 +504,13 @@ namespace OpenSim.Region.Physics.OdePlugin
499 m_bankingEfficiency = -0.2f; 504 m_bankingEfficiency = -0.2f;
500 m_bankingMix = 1; 505 m_bankingMix = 1;
501 m_bankingTimescale = 1; 506 m_bankingTimescale = 1;
502 m_flags &= ~(VehicleFlag.HOVER_WATER_ONLY | VehicleFlag.HOVER_TERRAIN_ONLY | VehicleFlag.HOVER_GLOBAL_HEIGHT); 507 m_flags &= ~(VehicleFlag.HOVER_WATER_ONLY |
503 m_flags |= (VehicleFlag.NO_DEFLECTION_UP | VehicleFlag.LIMIT_ROLL_ONLY | 508 VehicleFlag.HOVER_TERRAIN_ONLY |
504 VehicleFlag.LIMIT_MOTOR_UP | VehicleFlag.HOVER_UP_ONLY); 509 VehicleFlag.HOVER_GLOBAL_HEIGHT);
510 m_flags |= (VehicleFlag.NO_DEFLECTION_UP |
511 VehicleFlag.LIMIT_ROLL_ONLY |
512 VehicleFlag.LIMIT_MOTOR_UP |
513 VehicleFlag.HOVER_UP_ONLY);
505 break; 514 break;
506 case Vehicle.TYPE_BOAT: 515 case Vehicle.TYPE_BOAT:
507 m_linearFrictionTimescale = new Vector3(10, 3, 2); 516 m_linearFrictionTimescale = new Vector3(10, 3, 2);
@@ -525,12 +534,14 @@ namespace OpenSim.Region.Physics.OdePlugin
525 m_bankingTimescale = 1; 534 m_bankingTimescale = 1;
526 m_flags &= ~(VehicleFlag.HOVER_TERRAIN_ONLY | 535 m_flags &= ~(VehicleFlag.HOVER_TERRAIN_ONLY |
527 VehicleFlag.HOVER_GLOBAL_HEIGHT | 536 VehicleFlag.HOVER_GLOBAL_HEIGHT |
528 VehicleFlag.HOVER_UP_ONLY | 537 VehicleFlag.HOVER_UP_ONLY); // |
529 VehicleFlag.LIMIT_ROLL_ONLY); 538// VehicleFlag.LIMIT_ROLL_ONLY);
530 m_flags |= (VehicleFlag.NO_DEFLECTION_UP | 539 m_flags |= (VehicleFlag.NO_DEFLECTION_UP |
531 VehicleFlag.LIMIT_MOTOR_UP | 540 VehicleFlag.LIMIT_MOTOR_UP |
541 VehicleFlag.HOVER_UP_ONLY | // new sl
532 VehicleFlag.HOVER_WATER_ONLY); 542 VehicleFlag.HOVER_WATER_ONLY);
533 break; 543 break;
544
534 case Vehicle.TYPE_AIRPLANE: 545 case Vehicle.TYPE_AIRPLANE:
535 m_linearFrictionTimescale = new Vector3(200, 10, 5); 546 m_linearFrictionTimescale = new Vector3(200, 10, 5);
536 m_angularFrictionTimescale = new Vector3(20, 20, 20); 547 m_angularFrictionTimescale = new Vector3(20, 20, 20);
@@ -559,6 +570,7 @@ namespace OpenSim.Region.Physics.OdePlugin
559 VehicleFlag.LIMIT_MOTOR_UP); 570 VehicleFlag.LIMIT_MOTOR_UP);
560 m_flags |= (VehicleFlag.LIMIT_ROLL_ONLY); 571 m_flags |= (VehicleFlag.LIMIT_ROLL_ONLY);
561 break; 572 break;
573
562 case Vehicle.TYPE_BALLOON: 574 case Vehicle.TYPE_BALLOON:
563 m_linearFrictionTimescale = new Vector3(5, 5, 5); 575 m_linearFrictionTimescale = new Vector3(5, 5, 5);
564 m_angularFrictionTimescale = new Vector3(10, 10, 10); 576 m_angularFrictionTimescale = new Vector3(10, 10, 10);
@@ -574,7 +586,7 @@ namespace OpenSim.Region.Physics.OdePlugin
574 m_linearDeflectionTimescale = 5 * m_invtimestep; 586 m_linearDeflectionTimescale = 5 * m_invtimestep;
575 m_angularDeflectionEfficiency = 0; 587 m_angularDeflectionEfficiency = 0;
576 m_angularDeflectionTimescale = 5; 588 m_angularDeflectionTimescale = 5;
577 m_verticalAttractionEfficiency = 0f; 589 m_verticalAttractionEfficiency = 1f;
578 m_verticalAttractionTimescale = 1000f; 590 m_verticalAttractionTimescale = 1000f;
579 m_bankingEfficiency = 0; 591 m_bankingEfficiency = 0;
580 m_bankingMix = 0.7f; 592 m_bankingMix = 0.7f;
@@ -583,9 +595,12 @@ namespace OpenSim.Region.Physics.OdePlugin
583 VehicleFlag.HOVER_TERRAIN_ONLY | 595 VehicleFlag.HOVER_TERRAIN_ONLY |
584 VehicleFlag.HOVER_UP_ONLY | 596 VehicleFlag.HOVER_UP_ONLY |
585 VehicleFlag.NO_DEFLECTION_UP | 597 VehicleFlag.NO_DEFLECTION_UP |
586 VehicleFlag.LIMIT_MOTOR_UP); 598 VehicleFlag.LIMIT_MOTOR_UP | //);
587 m_flags |= (VehicleFlag.LIMIT_ROLL_ONLY | 599 VehicleFlag.LIMIT_ROLL_ONLY | // new sl
588 VehicleFlag.HOVER_GLOBAL_HEIGHT); 600 VehicleFlag.HOVER_GLOBAL_HEIGHT); // new sl
601
602// m_flags |= (VehicleFlag.LIMIT_ROLL_ONLY |
603// VehicleFlag.HOVER_GLOBAL_HEIGHT);
589 break; 604 break;
590 } 605 }
591 606
@@ -768,9 +783,11 @@ namespace OpenSim.Region.Physics.OdePlugin
768 } 783 }
769 784
770 // hover 785 // hover
771 if (m_VhoverTimescale < 300) 786 if (m_VhoverTimescale < 300 && rootPrim.prim_geom != IntPtr.Zero)
772 { 787 {
773 d.Vector3 pos = d.BodyGetPosition(Body); 788 // d.Vector3 pos = d.BodyGetPosition(Body);
789 d.Vector3 pos = d.GeomGetPosition(rootPrim.prim_geom);
790 pos.Z -= 0.21f; // minor offset that seems to be always there in sl
774 791
775 float t = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y); 792 float t = _pParentScene.GetTerrainHeightAtXY(pos.X, pos.Y);
776 float perr; 793 float perr;
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
index 2bcce31..e4f2e6b 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
@@ -843,7 +843,7 @@ namespace OpenSim.Region.Physics.OdePlugin
843 { 843 {
844 if (force.IsFinite()) 844 if (force.IsFinite())
845 { 845 {
846 AddChange(changes.AddAngForce, force * m_invTimeStep); 846 AddChange(changes.AddAngForce, force);
847 } 847 }
848 else 848 else
849 { 849 {
@@ -3217,7 +3217,7 @@ namespace OpenSim.Region.Physics.OdePlugin
3217 3217
3218 private void changeAddImpulse(Vector3 impulse) 3218 private void changeAddImpulse(Vector3 impulse)
3219 { 3219 {
3220 m_forceacc += impulse * m_invTimeStep; 3220 m_forceacc += impulse *m_invTimeStep;
3221 if (!m_isSelected) 3221 if (!m_isSelected)
3222 { 3222 {
3223 lock (this) 3223 lock (this)