diff options
author | UbitUmarov | 2015-10-01 14:47:32 +0100 |
---|---|---|
committer | UbitUmarov | 2015-10-01 14:47:32 +0100 |
commit | 2abe1ccc59a9d9715a534509631ada86fec6497e (patch) | |
tree | d6c05d4b8102c86e89ae202a4678fca4b6be0b33 /OpenSim/Region/Framework/Scenes/Scene.cs | |
parent | remove a forgotten if that is actually only a statement (diff) | |
download | opensim-SC-2abe1ccc59a9d9715a534509631ada86fec6497e.zip opensim-SC-2abe1ccc59a9d9715a534509631ada86fec6497e.tar.gz opensim-SC-2abe1ccc59a9d9715a534509631ada86fec6497e.tar.bz2 opensim-SC-2abe1ccc59a9d9715a534509631ada86fec6497e.tar.xz |
change GetNewRezLocation physics ray results processing
Diffstat (limited to 'OpenSim/Region/Framework/Scenes/Scene.cs')
-rwxr-xr-x | OpenSim/Region/Framework/Scenes/Scene.cs | 59 |
1 files changed, 38 insertions, 21 deletions
diff --git a/OpenSim/Region/Framework/Scenes/Scene.cs b/OpenSim/Region/Framework/Scenes/Scene.cs index 834f8fb..e47aa9c 100755 --- a/OpenSim/Region/Framework/Scenes/Scene.cs +++ b/OpenSim/Region/Framework/Scenes/Scene.cs | |||
@@ -2306,7 +2306,7 @@ namespace OpenSim.Region.Framework.Scenes | |||
2306 | { | 2306 | { |
2307 | Vector3 direction = dir * (1 / dist); | 2307 | Vector3 direction = dir * (1 / dist); |
2308 | 2308 | ||
2309 | dist += 2.0f; | 2309 | dist += 1.0f; |
2310 | 2310 | ||
2311 | if (SupportsRayCastFiltered()) | 2311 | if (SupportsRayCastFiltered()) |
2312 | { | 2312 | { |
@@ -2323,31 +2323,48 @@ namespace OpenSim.Region.Framework.Scenes | |||
2323 | (List<ContactResult>)RayCastFiltered(RayStart, direction, dist, physcount, rayfilter); | 2323 | (List<ContactResult>)RayCastFiltered(RayStart, direction, dist, physcount, rayfilter); |
2324 | if (physresults != null && physresults.Count > 0) | 2324 | if (physresults != null && physresults.Count > 0) |
2325 | { | 2325 | { |
2326 | if (physresults[0].ConsumerID == 0 || RayTargetID == UUID.Zero) | 2326 | // look for terrain ? |
2327 | if(RayTargetID == UUID.Zero) | ||
2327 | { | 2328 | { |
2328 | // found something | 2329 | foreach (ContactResult r in physresults) |
2329 | pos = physresults[0].Normal * scale; | 2330 | { |
2330 | pos *= 0.5f; | 2331 | if (r.ConsumerID == 0) |
2331 | pos = physresults[0].Pos + pos; | 2332 | { |
2332 | 2333 | pos = r.Normal * scale; | |
2333 | if (wpos.Z > pos.Z) pos = wpos; | 2334 | pos *= 0.5f; |
2334 | return pos; | 2335 | pos = r.Pos + pos; |
2336 | |||
2337 | if (wpos.Z > pos.Z) pos = wpos; | ||
2338 | return pos; | ||
2339 | } | ||
2340 | } | ||
2335 | } | 2341 | } |
2336 | foreach (ContactResult r in physresults) | 2342 | else |
2337 | { | 2343 | { |
2338 | SceneObjectPart part = GetSceneObjectPart(r.ConsumerID); | 2344 | foreach (ContactResult r in physresults) |
2339 | if (part == null) | ||
2340 | continue; | ||
2341 | if (part.UUID == RayTargetID) | ||
2342 | { | 2345 | { |
2343 | pos = physresults[0].Normal * scale; | 2346 | SceneObjectPart part = GetSceneObjectPart(r.ConsumerID); |
2344 | pos *= 0.5f; | 2347 | if (part == null) |
2345 | pos = physresults[0].Pos + pos; | 2348 | continue; |
2346 | 2349 | if (part.UUID == RayTargetID) | |
2347 | if (wpos.Z > pos.Z) pos = wpos; | 2350 | { |
2348 | return pos; | 2351 | pos = r.Normal * scale; |
2349 | } | 2352 | pos *= 0.5f; |
2353 | pos = r.Pos + pos; | ||
2354 | |||
2355 | if (wpos.Z > pos.Z) pos = wpos; | ||
2356 | return pos; | ||
2357 | } | ||
2358 | } | ||
2350 | } | 2359 | } |
2360 | // else the first we got | ||
2361 | pos = physresults[0].Normal * scale; | ||
2362 | pos *= 0.5f; | ||
2363 | pos = physresults[0].Pos + pos; | ||
2364 | |||
2365 | if (wpos.Z > pos.Z) | ||
2366 | pos = wpos; | ||
2367 | return pos; | ||
2351 | } | 2368 | } |
2352 | 2369 | ||
2353 | } | 2370 | } |