fix object rez on terrain, i broke adding physics assistance

avinationmerge
UbitUmarov 2015-09-26 02:33:57 +01:00
parent 0fb033e567
commit d0a7e5bd78
1 changed files with 19 additions and 11 deletions

View File

@ -2303,7 +2303,7 @@ namespace OpenSim.Region.Framework.Scenes
else else
{ {
Vector3 rayEnd = RayEnd; Vector3 rayEnd = RayEnd;
Vector3 dir = rayEnd - RayStart; Vector3 dir = rayEnd - RayStart;
float dist = dir.Length(); float dist = dir.Length();
if (dist != 0) if (dist != 0)
@ -2333,6 +2333,8 @@ namespace OpenSim.Region.Framework.Scenes
pos = physresults[0].Normal * scale; pos = physresults[0].Normal * scale;
pos *= 0.5f; pos *= 0.5f;
pos = physresults[0].Pos + pos; pos = physresults[0].Pos + pos;
if (wpos.Z > pos.Z) pos = wpos;
return pos; return pos;
} }
foreach (ContactResult r in physresults) foreach (ContactResult r in physresults)
@ -2345,6 +2347,8 @@ namespace OpenSim.Region.Framework.Scenes
pos = physresults[0].Normal * scale; pos = physresults[0].Normal * scale;
pos *= 0.5f; pos *= 0.5f;
pos = physresults[0].Pos + pos; pos = physresults[0].Pos + pos;
if (wpos.Z > pos.Z) pos = wpos;
return pos; return pos;
} }
} }
@ -2385,8 +2389,10 @@ namespace OpenSim.Region.Framework.Scenes
//Seems to make no sense to do this as this call is used for rezzing from inventory as well, and with inventory items their size is not always 0.5f //Seems to make no sense to do this as this call is used for rezzing from inventory as well, and with inventory items their size is not always 0.5f
//And in cases when we weren't rezzing from inventory we were re-adding the 0.25 straight after calling this method //And in cases when we weren't rezzing from inventory we were re-adding the 0.25 straight after calling this method
// Un-offset the prim (it gets offset later by the consumer method) // Un-offset the prim (it gets offset later by the consumer method)
//pos.Z -= 0.25F; //pos.Z -= 0.25F;
if (wpos.Z > pos.Z) pos = wpos;
return pos;
} }
} }
else else
@ -2406,20 +2412,22 @@ namespace OpenSim.Region.Framework.Scenes
// fall back to our stupid functionality // fall back to our stupid functionality
pos = RayEnd; pos = RayEnd;
} }
if (wpos.Z > pos.Z) pos = wpos;
return pos;
} }
} }
} }
else
{
// fall back to our stupid functionality
pos = RayEnd;
//increase height so its above the ground.
//should be getting the normal of the ground at the rez point and using that?
pos.Z += scale.Z / 2f;
// return pos;
}
} }
// fall back to our stupid functionality
pos = RayEnd;
//increase height so its above the ground.
//should be getting the normal of the ground at the rez point and using that?
pos.Z += scale.Z / 2f;
// return pos;
// check against posible water intercept // check against posible water intercept
if (wpos.Z > pos.Z) pos = wpos; if (wpos.Z > pos.Z) pos = wpos;
return pos; return pos;