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.avinationmerge
parent
c75508ec8d
commit
dd6ddcc7a5
|
@ -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)
|
||||
|
|
Loading…
Reference in New Issue