diff options
author | UbitUmarov | 2016-07-25 07:06:36 +0100 |
---|---|---|
committer | UbitUmarov | 2016-07-25 07:06:36 +0100 |
commit | aa9503ab8616f11f9c579631213663df8e20d143 (patch) | |
tree | d25fb4b1ebc0fbfa51acf6ddd1bc31987954ec97 /OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | |
parent | ubOde bug fix (diff) | |
download | opensim-SC_OLD-aa9503ab8616f11f9c579631213663df8e20d143.zip opensim-SC_OLD-aa9503ab8616f11f9c579631213663df8e20d143.tar.gz opensim-SC_OLD-aa9503ab8616f11f9c579631213663df8e20d143.tar.bz2 opensim-SC_OLD-aa9503ab8616f11f9c579631213663df8e20d143.tar.xz |
revert bad last changes and fix the issue another way
Diffstat (limited to 'OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs')
-rw-r--r-- | OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | 17 |
1 files changed, 9 insertions, 8 deletions
diff --git a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs index e475d84..ee80b10 100644 --- a/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs +++ b/OpenSim/Region/PhysicsModules/ubOde/ODEScene.cs | |||
@@ -874,7 +874,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
874 | break; | 874 | break; |
875 | 875 | ||
876 | case (int)ActorTypes.Prim: | 876 | case (int)ActorTypes.Prim: |
877 | Vector3 relV = p1.Velocity - p2.Velocity; | 877 | Vector3 relV = p1.rootVelocity - p2.rootVelocity; |
878 | float relVlenSQ = relV.LengthSquared(); | 878 | float relVlenSQ = relV.LengthSquared(); |
879 | if (relVlenSQ > 0.0001f) | 879 | if (relVlenSQ > 0.0001f) |
880 | { | 880 | { |
@@ -899,7 +899,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
899 | bounce = contactdata1.bounce * TerrainBounce; | 899 | bounce = contactdata1.bounce * TerrainBounce; |
900 | mu = (float)Math.Sqrt(contactdata1.mu * TerrainFriction); | 900 | mu = (float)Math.Sqrt(contactdata1.mu * TerrainFriction); |
901 | 901 | ||
902 | if (Math.Abs(p1.Velocity.X) > 0.1f || Math.Abs(p1.Velocity.Y) > 0.1f) | 902 | Vector3 v1 = p1.rootVelocity; |
903 | if (Math.Abs(v1.X) > 0.1f || Math.Abs(v1.Y) > 0.1f) | ||
903 | mu *= frictionMovementMult; | 904 | mu *= frictionMovementMult; |
904 | p1.CollidingGround = true; | 905 | p1.CollidingGround = true; |
905 | 906 | ||
@@ -925,8 +926,8 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
925 | 926 | ||
926 | // if (curContact.side1 > 0) // should be 2 ? | 927 | // if (curContact.side1 > 0) // should be 2 ? |
927 | // IgnoreNegSides = true; | 928 | // IgnoreNegSides = true; |
928 | 929 | Vector3 v2 = p2.rootVelocity; | |
929 | if (Math.Abs(p2.Velocity.X) > 0.1f || Math.Abs(p2.Velocity.Y) > 0.1f) | 930 | if (Math.Abs(v2.X) > 0.1f || Math.Abs(v2.Y) > 0.1f) |
930 | mu *= frictionMovementMult; | 931 | mu *= frictionMovementMult; |
931 | 932 | ||
932 | if(d.GeomGetClass(g2) == d.GeomClassID.TriMeshClass) | 933 | if(d.GeomGetClass(g2) == d.GeomClassID.TriMeshClass) |
@@ -980,7 +981,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
980 | p1.CollidingObj = true; | 981 | p1.CollidingObj = true; |
981 | p2.CollidingObj = true; | 982 | p2.CollidingObj = true; |
982 | } | 983 | } |
983 | else if (p2.Velocity.LengthSquared() > 0.0f) | 984 | else if (p2.rootVelocity.LengthSquared() > 0.0f) |
984 | p2.CollidingObj = true; | 985 | p2.CollidingObj = true; |
985 | } | 986 | } |
986 | else | 987 | else |
@@ -995,7 +996,7 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
995 | p1.CollidingObj = true; | 996 | p1.CollidingObj = true; |
996 | p2.CollidingObj = true; | 997 | p2.CollidingObj = true; |
997 | } | 998 | } |
998 | else if (p1.Velocity.LengthSquared() > 0.0f) | 999 | else if (p1.rootVelocity.LengthSquared() > 0.0f) |
999 | p1.CollidingObj = true; | 1000 | p1.CollidingObj = true; |
1000 | } | 1001 | } |
1001 | else | 1002 | else |
@@ -1068,10 +1069,10 @@ namespace OpenSim.Region.PhysicsModule.ubOde | |||
1068 | 1069 | ||
1069 | Vector3 vel = Vector3.Zero; | 1070 | Vector3 vel = Vector3.Zero; |
1070 | if (p2 != null && p2.IsPhysical) | 1071 | if (p2 != null && p2.IsPhysical) |
1071 | vel = p2.Velocity; | 1072 | vel = p2.rootVelocity; |
1072 | 1073 | ||
1073 | if (p1 != null && p1.IsPhysical) | 1074 | if (p1 != null && p1.IsPhysical) |
1074 | vel -= p1.Velocity; | 1075 | vel -= p1.rootVelocity; |
1075 | 1076 | ||
1076 | contact.RelativeSpeed = Vector3.Dot(vel, contact.SurfaceNormal); | 1077 | contact.RelativeSpeed = Vector3.Dot(vel, contact.SurfaceNormal); |
1077 | 1078 | ||