diff options
Diffstat (limited to 'OpenSim/Region/Physics/UbitOdePlugin')
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | 28 |
1 files changed, 27 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs index bea34d4..238e6e9 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs | |||
@@ -1045,12 +1045,37 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1045 | if (me == midbox) | 1045 | if (me == midbox) |
1046 | { | 1046 | { |
1047 | if (Math.Abs(contact.normal.Z) > 0.95f) | 1047 | if (Math.Abs(contact.normal.Z) > 0.95f) |
1048 | { | ||
1048 | offset.Z = contact.pos.Z - _position.Z; | 1049 | offset.Z = contact.pos.Z - _position.Z; |
1050 | offset.X = (float)Math.Abs(offset.X) * 0.5f + contact.depth; | ||
1051 | offset.Y = (float)Math.Abs(offset.Y) * 0.5f + contact.depth; | ||
1052 | offset.Z = (float)Math.Abs(offset.Z) * 0.5f + contact.depth; | ||
1053 | |||
1054 | if (reverse) | ||
1055 | { | ||
1056 | offset.X *= -contact.normal.X; | ||
1057 | offset.Y *= -contact.normal.Y; | ||
1058 | offset.Z *= -contact.normal.Z; | ||
1059 | } | ||
1060 | else | ||
1061 | { | ||
1062 | offset.X *= contact.normal.X; | ||
1063 | offset.Y *= contact.normal.Y; | ||
1064 | offset.Z *= contact.normal.Z; | ||
1065 | } | ||
1066 | |||
1067 | offset.X += contact.pos.X; | ||
1068 | offset.Y += contact.pos.Y; | ||
1069 | offset.Z += contact.pos.Z; | ||
1070 | _position = offset; | ||
1071 | return true; | ||
1072 | } | ||
1049 | else | 1073 | else |
1050 | offset.Z = contact.normal.Z; | 1074 | offset.Z = contact.normal.Z; |
1051 | 1075 | ||
1052 | offset.Normalize(); | 1076 | offset.Normalize(); |
1053 | 1077 | ||
1078 | /* | ||
1054 | if (reverse) | 1079 | if (reverse) |
1055 | { | 1080 | { |
1056 | contact.normal.X = offset.X; | 1081 | contact.normal.X = offset.X; |
@@ -1063,7 +1088,8 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
1063 | contact.normal.Y = -offset.Y; | 1088 | contact.normal.Y = -offset.Y; |
1064 | contact.normal.Z = -offset.Z; | 1089 | contact.normal.Z = -offset.Z; |
1065 | } | 1090 | } |
1066 | 1091 | */ | |
1092 | //_position.Z = offset.Z; | ||
1067 | return true; | 1093 | return true; |
1068 | } | 1094 | } |
1069 | 1095 | ||