aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics
diff options
context:
space:
mode:
authorMelanie2012-05-29 08:45:44 +0200
committerMelanie2012-05-29 08:45:44 +0200
commit9129a0cce4533413d2066fabfc7265e0d72caf20 (patch)
treed69aa4f4f6c7e4e9d63a9039b3aa65844725590c /OpenSim/Region/Physics
parentMerge branch 'avination' into careminster (diff)
parent fix avatars collisions on sim crossings and other few cases where freemove()... (diff)
downloadopensim-SC_OLD-9129a0cce4533413d2066fabfc7265e0d72caf20.zip
opensim-SC_OLD-9129a0cce4533413d2066fabfc7265e0d72caf20.tar.gz
opensim-SC_OLD-9129a0cce4533413d2066fabfc7265e0d72caf20.tar.bz2
opensim-SC_OLD-9129a0cce4533413d2066fabfc7265e0d72caf20.tar.xz
Merge branch 'avination'
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsActor.cs29
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs26
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs12
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs137
4 files changed, 134 insertions, 70 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsActor.cs b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
index fb90887..aaeae86 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsActor.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsActor.cs
@@ -294,6 +294,34 @@ namespace OpenSim.Region.Physics.Manager
294 public abstract Vector3 GeometricCenter { get; } 294 public abstract Vector3 GeometricCenter { get; }
295 public abstract Vector3 CenterOfMass { get; } 295 public abstract Vector3 CenterOfMass { get; }
296 296
297 public virtual Vector3 OOBsize
298 {
299 get
300 {
301 Vector3 s=Size;
302 s.X *=0.5f;
303 s.Y *=0.5f;
304 s.Z *=0.5f;
305 return s;
306 }
307 }
308
309 public virtual Vector3 OOBoffset
310 {
311 get
312 {
313 return Vector3.Zero;
314 }
315 }
316
317 public virtual float OOBRadiusSQ
318 {
319 get
320 {
321 return Size.LengthSquared() * 0.25f; // ((0.5^2)
322 }
323 }
324
297 /// <summary> 325 /// <summary>
298 /// Velocity of this actor. 326 /// Velocity of this actor.
299 /// </summary> 327 /// </summary>
@@ -429,7 +457,6 @@ namespace OpenSim.Region.Physics.Manager
429 457
430 public override void VehicleFloatParam(int param, float value) 458 public override void VehicleFloatParam(int param, float value)
431 { 459 {
432
433 } 460 }
434 461
435 public override void VehicleVectorParam(int param, Vector3 value) 462 public override void VehicleVectorParam(int param, Vector3 value)
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
index 1084b0e..093bc3c 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
@@ -522,29 +522,6 @@ namespace OpenSim.Region.Physics.OdePlugin
522 } 522 }
523 } 523 }
524 524
525 //UBit mess
526 /* for later use
527 public override Vector3 PrimOOBsize
528 {
529 get
530 {
531 Vector3 s=Size;
532 s.X *=0.5f;
533 s.Y *=0.5f;
534 s.Z *=0.5f;
535 return s;
536 }
537 }
538
539 public override Vector3 PrimOOBoffset
540 {
541 get
542 {
543 return Vector3.Zero;
544 }
545 }
546 */
547
548 public override PrimitiveBaseShape Shape 525 public override PrimitiveBaseShape Shape
549 { 526 {
550 set { return; } 527 set { return; }
@@ -1345,8 +1322,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1345 m_iscollidingGround = false; 1322 m_iscollidingGround = false;
1346 m_iscollidingObj = false; 1323 m_iscollidingObj = false;
1347 1324
1348 CollisionEventsThisFrame = new CollisionEventUpdate(); 1325 CollisionEventsThisFrame.Clear();
1349 m_eventsubscription = 0;
1350 } 1326 }
1351 1327
1352 private void changeForce(Vector3 newForce) 1328 private void changeForce(Vector3 newForce)
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
index 62fd279..5109a6a 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
@@ -504,8 +504,8 @@ namespace OpenSim.Region.Physics.OdePlugin
504 } 504 }
505 } 505 }
506 } 506 }
507/* 507
508 public override Vector3 PrimOOBsize 508 public override Vector3 OOBsize
509 { 509 {
510 get 510 get
511 { 511 {
@@ -513,7 +513,7 @@ namespace OpenSim.Region.Physics.OdePlugin
513 } 513 }
514 } 514 }
515 515
516 public override Vector3 PrimOOBoffset 516 public override Vector3 OOBoffset
517 { 517 {
518 get 518 get
519 { 519 {
@@ -521,14 +521,14 @@ namespace OpenSim.Region.Physics.OdePlugin
521 } 521 }
522 } 522 }
523 523
524 public override float PrimOOBRadiusSQ 524 public override float OOBRadiusSQ
525 { 525 {
526 get 526 get
527 { 527 {
528 return primOOBradiusSQ; 528 return primOOBradiusSQ;
529 } 529 }
530 } 530 }
531*/ 531
532 public override PrimitiveBaseShape Shape 532 public override PrimitiveBaseShape Shape
533 { 533 {
534 set 534 set
@@ -2562,10 +2562,10 @@ namespace OpenSim.Region.Physics.OdePlugin
2562 { 2562 {
2563 d.Quaternion qtmp; 2563 d.Quaternion qtmp;
2564 d.GeomCopyQuaternion(prim_geom, out qtmp); 2564 d.GeomCopyQuaternion(prim_geom, out qtmp);
2565 _orientation.W = qtmp.W;
2566 _orientation.X = qtmp.X; 2565 _orientation.X = qtmp.X;
2567 _orientation.Y = qtmp.Y; 2566 _orientation.Y = qtmp.Y;
2568 _orientation.Z = qtmp.Z; 2567 _orientation.Z = qtmp.Z;
2568 _orientation.W = qtmp.W;
2569 2569
2570 d.Vector3 lpos = d.GeomGetPosition(prim_geom); 2570 d.Vector3 lpos = d.GeomGetPosition(prim_geom);
2571 _position.X = lpos.X; 2571 _position.X = lpos.X;
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
index bfcfd21..286c7f0 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
@@ -1006,16 +1006,82 @@ namespace OpenSim.Region.Physics.OdePlugin
1006 else 1006 else
1007 1007
1008 { 1008 {
1009 if (dop1foot && (p1.Position.Z - curContact.pos.Z) > (p1.Size.Z - avCapRadius) * 0.5f)
1010 p1.IsColliding = true;
1011 if (dop2foot && (p2.Position.Z - curContact.pos.Z) > (p2.Size.Z - avCapRadius) * 0.5f)
1012 p2.IsColliding = true;
1013 1009
1014 if (AvanormOverride && curContact.depth > 0.3f) 1010 if (AvanormOverride)
1015 { 1011 {
1016 curContact.normal.X = normoverride.X; 1012 if (curContact.depth > 0.3f)
1017 curContact.normal.Y = normoverride.Y; 1013 {
1018 curContact.normal.Z = normoverride.Z; 1014 if (dop1foot && (p1.Position.Z - curContact.pos.Z) > (p1.Size.Z - avCapRadius) * 0.5f)
1015 p1.IsColliding = true;
1016 if (dop2foot && (p2.Position.Z - curContact.pos.Z) > (p2.Size.Z - avCapRadius) * 0.5f)
1017 p2.IsColliding = true;
1018 curContact.normal.X = normoverride.X;
1019 curContact.normal.Y = normoverride.Y;
1020 curContact.normal.Z = normoverride.Z;
1021 }
1022
1023 else
1024 {
1025 if (dop1foot)
1026 {
1027 float sz = p1.Size.Z;
1028 Vector3 vtmp = p1.Position;
1029 float ppos = curContact.pos.Z - vtmp.Z + (sz - avCapRadius) * 0.5f;
1030 if (ppos > 0f)
1031 {
1032 if (!p1.Flying)
1033 {
1034 d.AABB aabb;
1035 d.GeomGetAABB(g2, out aabb);
1036 float tmp = vtmp.Z - sz * .25f;
1037
1038 if (aabb.MaxZ < tmp)
1039 {
1040 vtmp.X = curContact.pos.X - vtmp.X;
1041 vtmp.Y = curContact.pos.Y - vtmp.Y;
1042 vtmp.Z = -0.2f;
1043 vtmp.Normalize();
1044 curContact.normal.X = vtmp.X;
1045 curContact.normal.Y = vtmp.Y;
1046 curContact.normal.Z = vtmp.Z;
1047 }
1048 }
1049 }
1050 else
1051 p1.IsColliding = true;
1052
1053 }
1054
1055 if (dop2foot)
1056 {
1057 float sz = p2.Size.Z;
1058 Vector3 vtmp = p2.Position;
1059 float ppos = curContact.pos.Z - vtmp.Z + (sz - avCapRadius) * 0.5f;
1060 if (ppos > 0f)
1061 {
1062 if (!p2.Flying)
1063 {
1064 d.AABB aabb;
1065 d.GeomGetAABB(g1, out aabb);
1066 float tmp = vtmp.Z - sz * .25f;
1067
1068 if (aabb.MaxZ < tmp)
1069 {
1070 vtmp.X = curContact.pos.X - vtmp.X;
1071 vtmp.Y = curContact.pos.Y - vtmp.Y;
1072 vtmp.Z = -0.2f;
1073 vtmp.Normalize();
1074 curContact.normal.X = vtmp.X;
1075 curContact.normal.Y = vtmp.Y;
1076 curContact.normal.Z = vtmp.Z;
1077 }
1078 }
1079 }
1080 else
1081 p2.IsColliding = true;
1082
1083 }
1084 }
1019 } 1085 }
1020 1086
1021 Joint = CreateContacJoint(ref curContact, mu, bounce, cfm, erpscale, dscale); 1087 Joint = CreateContacJoint(ref curContact, mu, bounce, cfm, erpscale, dscale);
@@ -1609,41 +1675,40 @@ namespace OpenSim.Region.Physics.OdePlugin
1609 /// <returns></returns> 1675 /// <returns></returns>
1610 public bool needsMeshing(PrimitiveBaseShape pbs) 1676 public bool needsMeshing(PrimitiveBaseShape pbs)
1611 { 1677 {
1612 // most of this is redundant now as the mesher will return null if it cant mesh a prim 1678 // check sculpts or meshs
1613 // but we still need to check for sculptie meshing being enabled so this is the most
1614 // convenient place to do it for now...
1615
1616 // //if (pbs.PathCurve == (byte)Primitive.PathCurve.Circle && pbs.ProfileCurve == (byte)Primitive.ProfileCurve.Circle && pbs.PathScaleY <= 0.75f)
1617 // //m_log.Debug("needsMeshing: " + " pathCurve: " + pbs.PathCurve.ToString() + " profileCurve: " + pbs.ProfileCurve.ToString() + " pathScaleY: " + Primitive.UnpackPathScale(pbs.PathScaleY).ToString());
1618 int iPropertiesNotSupportedDefault = 0;
1619
1620 if (pbs.SculptEntry) 1679 if (pbs.SculptEntry)
1621 { 1680 {
1622 if(!meshSculptedPrim) 1681 if (meshSculptedPrim)
1623 return false; 1682 return true;
1683
1684 if (pbs.SculptType == (byte)SculptType.Mesh) // always do meshs
1685 return true;
1686
1687 return false;
1624 } 1688 }
1625 1689
1690 if (forceSimplePrimMeshing)
1691 return true;
1692
1626 // if it's a standard box or sphere with no cuts, hollows, twist or top shear, return false since ODE can use an internal representation for the prim 1693 // if it's a standard box or sphere with no cuts, hollows, twist or top shear, return false since ODE can use an internal representation for the prim
1627 if (!forceSimplePrimMeshing && !pbs.SculptEntry) 1694
1628 { 1695 if ((pbs.ProfileShape == ProfileShape.Square && pbs.PathCurve == (byte)Extrusion.Straight)
1629 if ((pbs.ProfileShape == ProfileShape.Square && pbs.PathCurve == (byte)Extrusion.Straight)
1630 || (pbs.ProfileShape == ProfileShape.HalfCircle && pbs.PathCurve == (byte)Extrusion.Curve1 1696 || (pbs.ProfileShape == ProfileShape.HalfCircle && pbs.PathCurve == (byte)Extrusion.Curve1
1631 && pbs.Scale.X == pbs.Scale.Y && pbs.Scale.Y == pbs.Scale.Z)) 1697 && pbs.Scale.X == pbs.Scale.Y && pbs.Scale.Y == pbs.Scale.Z))
1632 { 1698 {
1633 1699
1634 if (pbs.ProfileBegin == 0 && pbs.ProfileEnd == 0 1700 if (pbs.ProfileBegin == 0 && pbs.ProfileEnd == 0
1635 && pbs.ProfileHollow == 0 1701 && pbs.ProfileHollow == 0
1636 && pbs.PathTwist == 0 && pbs.PathTwistBegin == 0 1702 && pbs.PathTwist == 0 && pbs.PathTwistBegin == 0
1637 && pbs.PathBegin == 0 && pbs.PathEnd == 0 1703 && pbs.PathBegin == 0 && pbs.PathEnd == 0
1638 && pbs.PathTaperX == 0 && pbs.PathTaperY == 0 1704 && pbs.PathTaperX == 0 && pbs.PathTaperY == 0
1639 && pbs.PathScaleX == 100 && pbs.PathScaleY == 100 1705 && pbs.PathScaleX == 100 && pbs.PathScaleY == 100
1640 && pbs.PathShearX == 0 && pbs.PathShearY == 0) 1706 && pbs.PathShearX == 0 && pbs.PathShearY == 0)
1641 { 1707 {
1642#if SPAM 1708#if SPAM
1643 m_log.Warn("NonMesh"); 1709 m_log.Warn("NonMesh");
1644#endif 1710#endif
1645 return false; 1711 return false;
1646 }
1647 } 1712 }
1648 } 1713 }
1649 1714
@@ -1651,8 +1716,7 @@ namespace OpenSim.Region.Physics.OdePlugin
1651 // and it's odd.. so for now just return true if asked to force meshs 1716 // and it's odd.. so for now just return true if asked to force meshs
1652 // hopefully mesher will fail if doesn't suport so things still get basic boxes 1717 // hopefully mesher will fail if doesn't suport so things still get basic boxes
1653 1718
1654 if (forceSimplePrimMeshing) 1719 int iPropertiesNotSupportedDefault = 0;
1655 return true;
1656 1720
1657 if (pbs.ProfileHollow != 0) 1721 if (pbs.ProfileHollow != 0)
1658 iPropertiesNotSupportedDefault++; 1722 iPropertiesNotSupportedDefault++;
@@ -1721,9 +1785,6 @@ namespace OpenSim.Region.Physics.OdePlugin
1721 } 1785 }
1722 } 1786 }
1723 1787
1724 if (pbs.SculptEntry && meshSculptedPrim)
1725 iPropertiesNotSupportedDefault++;
1726
1727 if (iPropertiesNotSupportedDefault == 0) 1788 if (iPropertiesNotSupportedDefault == 0)
1728 { 1789 {
1729#if SPAM 1790#if SPAM