diff options
Diffstat (limited to 'OpenSim/Region/Physics/UbitOdePlugin/ODESitAvatar.cs')
-rw-r--r-- | OpenSim/Region/Physics/UbitOdePlugin/ODESitAvatar.cs | 21 |
1 files changed, 11 insertions, 10 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODESitAvatar.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODESitAvatar.cs index ecc732a..e9023c3 100644 --- a/OpenSim/Region/Physics/UbitOdePlugin/ODESitAvatar.cs +++ b/OpenSim/Region/Physics/UbitOdePlugin/ODESitAvatar.cs | |||
@@ -78,8 +78,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
78 | 78 | ||
79 | IntPtr geom = ((OdePrim)actor).prim_geom; | 79 | IntPtr geom = ((OdePrim)actor).prim_geom; |
80 | 80 | ||
81 | Vector3 geopos = d.GeomGetPositionOMV(geom); | 81 | // Vector3 geopos = d.GeomGetPositionOMV(geom); |
82 | Quaternion geomOri = d.GeomGetQuaternionOMV(geom); | 82 | // Quaternion geomOri = d.GeomGetQuaternionOMV(geom); |
83 | |||
84 | Vector3 geopos = actor.Position; | ||
85 | Quaternion geomOri = actor.Orientation; | ||
86 | |||
83 | Quaternion geomInvOri = Quaternion.Conjugate(geomOri); | 87 | Quaternion geomInvOri = Quaternion.Conjugate(geomOri); |
84 | 88 | ||
85 | Quaternion ori = Quaternion.Identity; | 89 | Quaternion ori = Quaternion.Identity; |
@@ -116,6 +120,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
116 | } | 120 | } |
117 | 121 | ||
118 | int status = 1; | 122 | int status = 1; |
123 | |||
119 | offset = rayResults[0].Pos - geopos; | 124 | offset = rayResults[0].Pos - geopos; |
120 | 125 | ||
121 | d.GeomClassID geoclass = d.GeomGetClass(geom); | 126 | d.GeomClassID geoclass = d.GeomGetClass(geom); |
@@ -191,13 +196,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
191 | if (norm.Z < 0.5f) | 196 | if (norm.Z < 0.5f) |
192 | { | 197 | { |
193 | float rayDist = 4.0f; | 198 | float rayDist = 4.0f; |
194 | float curEdgeDist = 0.0f; | ||
195 | 199 | ||
196 | for (int i = 0; i < 6; i++) | 200 | for (int i = 0; i < 6; i++) |
197 | { | 201 | { |
198 | pivot.X -= 0.005f * norm.X; | 202 | pivot.X -= 0.01f * norm.X; |
199 | pivot.Y -= 0.005f * norm.Y; | 203 | pivot.Y -= 0.01f * norm.Y; |
200 | pivot.Z -= 0.005f * norm.Z; | 204 | pivot.Z -= 0.01f * norm.Z; |
201 | 205 | ||
202 | rayDir.X = -norm.X * norm.Z; | 206 | rayDir.X = -norm.X * norm.Z; |
203 | rayDir.Y = -norm.Y * norm.Z; | 207 | rayDir.Y = -norm.Y * norm.Z; |
@@ -208,8 +212,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
208 | if (rayResults.Count == 0) | 212 | if (rayResults.Count == 0) |
209 | break; | 213 | break; |
210 | 214 | ||
211 | curEdgeDist += rayResults[0].Depth; | ||
212 | |||
213 | if (Math.Abs(rayResults[0].Normal.Z) < 0.7f) | 215 | if (Math.Abs(rayResults[0].Normal.Z) < 0.7f) |
214 | { | 216 | { |
215 | rayDist -= rayResults[0].Depth; | 217 | rayDist -= rayResults[0].Depth; |
@@ -226,7 +228,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
226 | else | 228 | else |
227 | { | 229 | { |
228 | foundEdge = true; | 230 | foundEdge = true; |
229 | edgeDist = curEdgeDist; | ||
230 | edgePos = rayResults[0].Pos; | 231 | edgePos = rayResults[0].Pos; |
231 | break; | 232 | break; |
232 | } | 233 | } |
@@ -254,7 +255,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
254 | 255 | ||
255 | for (int i = 0; i < 3; i++) | 256 | for (int i = 0; i < 3; i++) |
256 | { | 257 | { |
257 | pivot.Z -= 0.005f; | 258 | pivot.Z -= 0.01f; |
258 | rayDir.X = toCamX; | 259 | rayDir.X = toCamX; |
259 | rayDir.Y = toCamY; | 260 | rayDir.Y = toCamY; |
260 | rayDir.Z = (-toCamX * norm.X - toCamY * norm.Y) / norm.Z; | 261 | rayDir.Z = (-toCamX * norm.X - toCamY * norm.Y) / norm.Z; |