aboutsummaryrefslogtreecommitdiffstatshomepage
diff options
context:
space:
mode:
authorMelanie2012-05-02 00:33:37 +0200
committerMelanie2012-05-02 00:33:37 +0200
commit82197c87a25190176d8c2519f73117ecf3903a90 (patch)
tree5fdee30b07c04bab6391df6ed843583d2fb6d262
parentPreserve attachment rotation on objects rezzed via a script. Makes toasters (diff)
parentubitODE fix applyROtationImpulse, let vehicle hover be relative to root prim... (diff)
downloadopensim-SC_OLD-82197c87a25190176d8c2519f73117ecf3903a90.zip
opensim-SC_OLD-82197c87a25190176d8c2519f73117ecf3903a90.tar.gz
opensim-SC_OLD-82197c87a25190176d8c2519f73117ecf3903a90.tar.bz2
opensim-SC_OLD-82197c87a25190176d8c2519f73117ecf3903a90.tar.xz
Merge branch 'ubitwork' into avination
-rw-r--r--OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs16
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/ODEDynamics.cs43
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs182
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs10
-rw-r--r--OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs3
5 files changed, 139 insertions, 115 deletions
diff --git a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
index 10d53d7..76804d7 100644
--- a/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
+++ b/OpenSim/Region/Framework/Scenes/SceneObjectGroup.cs
@@ -4024,13 +4024,25 @@ namespace OpenSim.Region.Framework.Scenes
4024 if (nparts <= 1) 4024 if (nparts <= 1)
4025 return gc; 4025 return gc;
4026 4026
4027 Quaternion parentRot = RootPart.RotationOffset;
4028 Vector3 pPos;
4029
4027 // average all parts positions 4030 // average all parts positions
4028 for (int i = 0; i < nparts; i++) 4031 for (int i = 0; i < nparts; i++)
4029 gc += parts[i].GetWorldPosition(); 4032 {
4033 // do it directly
4034 // gc += parts[i].GetWorldPosition();
4035 if (parts[i] != RootPart)
4036 {
4037 pPos = parts[i].OffsetPosition;
4038 gc += pPos;
4039 }
4040
4041 }
4030 gc /= nparts; 4042 gc /= nparts;
4031 4043
4032 // relative to root: 4044 // relative to root:
4033 gc -= AbsolutePosition; 4045// gc -= AbsolutePosition;
4034 return gc; 4046 return gc;
4035 } 4047 }
4036 4048
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 c9a453d..e4f2e6b 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
@@ -449,54 +449,57 @@ namespace OpenSim.Region.Physics.OdePlugin
449 { 449 {
450 get 450 get
451 { 451 {
452 d.Vector3 dtmp; 452 lock (_parent_scene.OdeLock)
453 if (!childPrim && Body != IntPtr.Zero)
454 {
455 dtmp = d.BodyGetPosition(Body);
456 return new Vector3(dtmp.X, dtmp.Y, dtmp.Z);
457 }
458 else if (prim_geom != IntPtr.Zero)
459 { 453 {
460 d.Quaternion dq; 454 d.Vector3 dtmp;
461 d.GeomCopyQuaternion(prim_geom, out dq); 455 if (!childPrim && Body != IntPtr.Zero)
462 Quaternion q;
463 q.X = dq.X;
464 q.Y = dq.Y;
465 q.Z = dq.Z;
466 q.W = dq.W;
467
468 Vector3 Ptot = primOOBoffset * q;
469 dtmp = d.GeomGetPosition(prim_geom);
470 Ptot.X += dtmp.X;
471 Ptot.Y += dtmp.Y;
472 Ptot.Z += dtmp.Z;
473
474// if(childPrim) we only know about physical linksets
475 return Ptot;
476/*
477 float tmass = _mass;
478 Ptot *= tmass;
479
480 float m;
481
482 foreach (OdePrim prm in childrenPrim)
483 { 456 {
484 m = prm._mass; 457 dtmp = d.BodyGetPosition(Body);
485 Ptot += prm.CenterOfMass * m; 458 return new Vector3(dtmp.X, dtmp.Y, dtmp.Z);
486 tmass += m; 459 }
460 else if (prim_geom != IntPtr.Zero)
461 {
462 d.Quaternion dq;
463 d.GeomCopyQuaternion(prim_geom, out dq);
464 Quaternion q;
465 q.X = dq.X;
466 q.Y = dq.Y;
467 q.Z = dq.Z;
468 q.W = dq.W;
469
470 Vector3 Ptot = primOOBoffset * q;
471 dtmp = d.GeomGetPosition(prim_geom);
472 Ptot.X += dtmp.X;
473 Ptot.Y += dtmp.Y;
474 Ptot.Z += dtmp.Z;
475
476 // if(childPrim) we only know about physical linksets
477 return Ptot;
478 /*
479 float tmass = _mass;
480 Ptot *= tmass;
481
482 float m;
483
484 foreach (OdePrim prm in childrenPrim)
485 {
486 m = prm._mass;
487 Ptot += prm.CenterOfMass * m;
488 tmass += m;
489 }
490
491 if (tmass == 0)
492 tmass = 0;
493 else
494 tmass = 1.0f / tmass;
495
496 Ptot *= tmass;
497 return Ptot;
498 */
487 } 499 }
488
489 if (tmass == 0)
490 tmass = 0;
491 else 500 else
492 tmass = 1.0f / tmass; 501 return _position;
493
494 Ptot *= tmass;
495 return Ptot;
496 */
497 } 502 }
498 else
499 return _position;
500 } 503 }
501 } 504 }
502 /* 505 /*
@@ -840,7 +843,7 @@ namespace OpenSim.Region.Physics.OdePlugin
840 { 843 {
841 if (force.IsFinite()) 844 if (force.IsFinite())
842 { 845 {
843 AddChange(changes.AddAngForce, force * m_invTimeStep); 846 AddChange(changes.AddAngForce, force);
844 } 847 }
845 else 848 else
846 { 849 {
@@ -1511,7 +1514,6 @@ namespace OpenSim.Region.Physics.OdePlugin
1511 } 1514 }
1512 Body = IntPtr.Zero; 1515 Body = IntPtr.Zero;
1513 hasOOBoffsetFromMesh = false; 1516 hasOOBoffsetFromMesh = false;
1514 CalcPrimBodyData();
1515 } 1517 }
1516/* 1518/*
1517 private void ChildSetGeom(OdePrim odePrim) 1519 private void ChildSetGeom(OdePrim odePrim)
@@ -1601,7 +1603,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1601 1603
1602 Body = d.BodyCreate(_parent_scene.world); 1604 Body = d.BodyCreate(_parent_scene.world);
1603 1605
1604 DMassDup(ref primdMass, out objdmass); 1606 objdmass = primdMass;
1605 1607
1606 // rotate inertia 1608 // rotate inertia
1607 myrot.X = _orientation.X; 1609 myrot.X = _orientation.X;
@@ -1623,9 +1625,9 @@ namespace OpenSim.Region.Physics.OdePlugin
1623 d.Mass tmpdmass = new d.Mass { }; 1625 d.Mass tmpdmass = new d.Mass { };
1624 Vector3 rcm; 1626 Vector3 rcm;
1625 1627
1626 rcm.X = _position.X + objdmass.c.X; 1628 rcm.X = _position.X;
1627 rcm.Y = _position.Y + objdmass.c.Y; 1629 rcm.Y = _position.Y;
1628 rcm.Z = _position.Z + objdmass.c.Z; 1630 rcm.Z = _position.Z;
1629 1631
1630 lock (childrenPrim) 1632 lock (childrenPrim)
1631 { 1633 {
@@ -1637,7 +1639,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1637 continue; 1639 continue;
1638 } 1640 }
1639 1641
1640 DMassCopy(ref prm.primdMass, ref tmpdmass); 1642 tmpdmass = prm.primdMass;
1641 1643
1642 // apply prim current rotation to inertia 1644 // apply prim current rotation to inertia
1643 quat.X = prm._orientation.X; 1645 quat.X = prm._orientation.X;
@@ -1648,10 +1650,9 @@ namespace OpenSim.Region.Physics.OdePlugin
1648 d.MassRotate(ref tmpdmass, ref mat); 1650 d.MassRotate(ref tmpdmass, ref mat);
1649 1651
1650 Vector3 ppos = prm._position; 1652 Vector3 ppos = prm._position;
1651 ppos.X += tmpdmass.c.X - rcm.X; 1653 ppos.X -= rcm.X;
1652 ppos.Y += tmpdmass.c.Y - rcm.Y; 1654 ppos.Y -= rcm.Y;
1653 ppos.Z += tmpdmass.c.Z - rcm.Z; 1655 ppos.Z -= rcm.Z;
1654
1655 // refer inertia to root prim center of mass position 1656 // refer inertia to root prim center of mass position
1656 d.MassTranslate(ref tmpdmass, 1657 d.MassTranslate(ref tmpdmass,
1657 ppos.X, 1658 ppos.X,
@@ -1683,9 +1684,13 @@ namespace OpenSim.Region.Physics.OdePlugin
1683 d.GeomSetOffsetWorldPosition(prim_geom, _position.X, _position.Y, _position.Z); 1684 d.GeomSetOffsetWorldPosition(prim_geom, _position.X, _position.Y, _position.Z);
1684 1685
1685 d.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body 1686 d.MassTranslate(ref objdmass, -objdmass.c.X, -objdmass.c.Y, -objdmass.c.Z); // ode wants inertia at center of body
1686 myrot.W = -myrot.W; 1687 myrot.X = -myrot.X;
1688 myrot.Y = -myrot.Y;
1689 myrot.Z = -myrot.Z;
1690
1687 d.RfromQ(out mymat, ref myrot); 1691 d.RfromQ(out mymat, ref myrot);
1688 d.MassRotate(ref objdmass, ref mymat); 1692 d.MassRotate(ref objdmass, ref mymat);
1693
1689 d.BodySetMass(Body, ref objdmass); 1694 d.BodySetMass(Body, ref objdmass);
1690 _mass = objdmass.mass; 1695 _mass = objdmass.mass;
1691 1696
@@ -2237,7 +2242,33 @@ namespace OpenSim.Region.Physics.OdePlugin
2237 case ProfileShape.HalfCircle: 2242 case ProfileShape.HalfCircle:
2238 if (_pbs.PathCurve == (byte)Extrusion.Curve1) 2243 if (_pbs.PathCurve == (byte)Extrusion.Curve1)
2239 { 2244 {
2240 volume *= 0.52359877559829887307710723054658f; 2245 volume *= 0.5236f;
2246
2247 if (hollowAmount > 0.0)
2248 {
2249 hollowVolume *= hollowAmount;
2250
2251 switch (_pbs.HollowShape)
2252 {
2253 case HollowShape.Circle:
2254 case HollowShape.Triangle: // diference in sl is minor and odd
2255 case HollowShape.Same:
2256 break;
2257
2258 case HollowShape.Square:
2259 hollowVolume *= 0.909f;
2260 break;
2261
2262 // case HollowShape.Triangle:
2263 // hollowVolume *= .827f;
2264 // break;
2265 default:
2266 hollowVolume = 0;
2267 break;
2268 }
2269 volume *= (1.0f - hollowVolume);
2270 }
2271
2241 } 2272 }
2242 break; 2273 break;
2243 2274
@@ -3186,7 +3217,7 @@ namespace OpenSim.Region.Physics.OdePlugin
3186 3217
3187 private void changeAddImpulse(Vector3 impulse) 3218 private void changeAddImpulse(Vector3 impulse)
3188 { 3219 {
3189 m_forceacc += impulse * m_invTimeStep; 3220 m_forceacc += impulse *m_invTimeStep;
3190 if (!m_isSelected) 3221 if (!m_isSelected)
3191 { 3222 {
3192 lock (this) 3223 lock (this)
@@ -3704,24 +3735,6 @@ namespace OpenSim.Region.Physics.OdePlugin
3704 return true; 3735 return true;
3705 } 3736 }
3706 3737
3707 internal static void DMassCopy(ref d.Mass src, ref d.Mass dst)
3708 {
3709 dst.c.W = src.c.W;
3710 dst.c.X = src.c.X;
3711 dst.c.Y = src.c.Y;
3712 dst.c.Z = src.c.Z;
3713 dst.mass = src.mass;
3714 dst.I.M00 = src.I.M00;
3715 dst.I.M01 = src.I.M01;
3716 dst.I.M02 = src.I.M02;
3717 dst.I.M10 = src.I.M10;
3718 dst.I.M11 = src.I.M11;
3719 dst.I.M12 = src.I.M12;
3720 dst.I.M20 = src.I.M20;
3721 dst.I.M21 = src.I.M21;
3722 dst.I.M22 = src.I.M22;
3723 }
3724
3725 internal static void DMassSubPartFromObj(ref d.Mass part, ref d.Mass theobj) 3738 internal static void DMassSubPartFromObj(ref d.Mass part, ref d.Mass theobj)
3726 { 3739 {
3727 // assumes object center of mass is zero 3740 // assumes object center of mass is zero
@@ -3745,25 +3758,6 @@ namespace OpenSim.Region.Physics.OdePlugin
3745 theobj.I.M22 -= part.I.M22; 3758 theobj.I.M22 -= part.I.M22;
3746 } 3759 }
3747 3760
3748 private static void DMassDup(ref d.Mass src, out d.Mass dst)
3749 {
3750 dst = new d.Mass { };
3751
3752 dst.c.W = src.c.W;
3753 dst.c.X = src.c.X;
3754 dst.c.Y = src.c.Y;
3755 dst.c.Z = src.c.Z;
3756 dst.mass = src.mass;
3757 dst.I.M00 = src.I.M00;
3758 dst.I.M01 = src.I.M01;
3759 dst.I.M02 = src.I.M02;
3760 dst.I.M10 = src.I.M10;
3761 dst.I.M11 = src.I.M11;
3762 dst.I.M12 = src.I.M12;
3763 dst.I.M20 = src.I.M20;
3764 dst.I.M21 = src.I.M21;
3765 dst.I.M22 = src.I.M22;
3766 }
3767 private void donullchange() 3761 private void donullchange()
3768 { 3762 {
3769 } 3763 }
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
index fa3d33e..84195d3 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
@@ -301,7 +301,7 @@ namespace OpenSim.Region.Physics.OdePlugin
301 // split static geometry collision into a grid as before 301 // split static geometry collision into a grid as before
302 private IntPtr[,] staticPrimspace; 302 private IntPtr[,] staticPrimspace;
303 303
304 private Object OdeLock; 304 public Object OdeLock;
305 private static Object SimulationLock; 305 private static Object SimulationLock;
306 306
307 public IMesher mesher; 307 public IMesher mesher;
@@ -746,8 +746,7 @@ namespace OpenSim.Region.Physics.OdePlugin
746 ); 746 );
747 // do volume detection case 747 // do volume detection case
748 if ( 748 if (
749 (p1 is OdePrim) && (((OdePrim)p1).m_isVolumeDetect) || 749 (p1.IsVolumeDtc || p2.IsVolumeDtc))
750 (p2 is OdePrim) && (((OdePrim)p2).m_isVolumeDetect))
751 { 750 {
752 collision_accounting_events(p1, p2, maxDepthContact); 751 collision_accounting_events(p1, p2, maxDepthContact);
753 return; 752 return;
@@ -1024,9 +1023,9 @@ namespace OpenSim.Region.Physics.OdePlugin
1024 bool p1events = p1.SubscribedEvents(); 1023 bool p1events = p1.SubscribedEvents();
1025 bool p2events = p2.SubscribedEvents(); 1024 bool p2events = p2.SubscribedEvents();
1026 1025
1027 if (p1 is OdePrim && p1.IsVolumeDtc) 1026 if (p1.IsVolumeDtc)
1028 p2events = false; 1027 p2events = false;
1029 if (p2 is OdePrim && p2.IsVolumeDtc) 1028 if (p2.IsVolumeDtc)
1030 p1events = false; 1029 p1events = false;
1031 1030
1032 if (!(p2events || p1events)) 1031 if (!(p2events || p1events))
@@ -1725,6 +1724,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1725// checkThread(); 1724// checkThread();
1726 1725
1727 lock (SimulationLock) 1726 lock (SimulationLock)
1727 lock(OdeLock)
1728 { 1728 {
1729 // adjust number of iterations per step 1729 // adjust number of iterations per step
1730 try 1730 try
diff --git a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
index 6ee1a5d..0c28bf5 100644
--- a/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
+++ b/OpenSim/Region/ScriptEngine/Shared/Api/Implementation/LSL_Api.cs
@@ -8527,7 +8527,8 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
8527 8527
8528 public LSL_Vector llGetGeometricCenter() 8528 public LSL_Vector llGetGeometricCenter()
8529 { 8529 {
8530 return new LSL_Vector(m_host.GetGeometricCenter().X, m_host.GetGeometricCenter().Y, m_host.GetGeometricCenter().Z); 8530 Vector3 tmp = m_host.GetGeometricCenter();
8531 return new LSL_Vector(tmp.X, tmp.Y, tmp.Z);
8531 } 8532 }
8532 8533
8533 public LSL_List llGetPrimitiveParams(LSL_List rules) 8534 public LSL_List llGetPrimitiveParams(LSL_List rules)