* Fix OBB raycaster to respond properly to rays cast from any direction.

0.6.0-stable
Teravus Ovares 2008-05-01 04:58:15 +00:00
parent 1d9c68969e
commit f4e22b1356
1 changed files with 4 additions and 1 deletions

View File

@ -1207,8 +1207,11 @@ namespace OpenSim.Region.Environment.Scenes
// If we hit something
if (ei.HitTF)
{
LLVector3 intersectionpoint = new LLVector3(ei.ipoint.x, ei.ipoint.y, ei.ipoint.z);
LLVector3 normal = new LLVector3(ei.normal.x, ei.normal.y, ei.normal.z);
// Set the position to the intersection point
pos = (new LLVector3(ei.ipoint.x, ei.ipoint.y, ei.ipoint.z) + (new LLVector3(ei.normal.x,ei.normal.x,ei.normal.z) * (0.5f/2f)));
LLVector3 offset = (normal * (0.5f / 2f));
pos = (intersectionpoint + offset);
// Un-offset the prim (it gets offset later by the consumer method)
pos.Z -= 0.25F;