mirror of
https://github.com/opensim/opensim.git
synced 2026-08-01 22:26:09 +08:00
Prevent double ground collisions and prefer the physics result if there is one.
ODE is known to not see the ground sometimes on raycast so the double test is needed.
This commit is contained in:
@@ -12287,11 +12287,23 @@ namespace OpenSim.Region.ScriptEngine.Shared.Api
|
||||
}
|
||||
}
|
||||
|
||||
// Double check this
|
||||
if (checkTerrain)
|
||||
{
|
||||
ContactResult? groundContact = GroundIntersection(rayStart, rayEnd);
|
||||
if (groundContact != null)
|
||||
results.Add((ContactResult)groundContact);
|
||||
bool skipGroundCheck = false;
|
||||
|
||||
foreach (ContactResult c in results)
|
||||
{
|
||||
if (c.ConsumerID == 0) // Physics gave us a ground collision
|
||||
skipGroundCheck = true;
|
||||
}
|
||||
|
||||
if (!skipGroundCheck)
|
||||
{
|
||||
ContactResult? groundContact = GroundIntersection(rayStart, rayEnd);
|
||||
if (groundContact != null)
|
||||
results.Add((ContactResult)groundContact);
|
||||
}
|
||||
}
|
||||
|
||||
results.Sort(delegate(ContactResult a, ContactResult b)
|
||||
|
||||
Reference in New Issue
Block a user