aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs')
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs137
1 files changed, 99 insertions, 38 deletions
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