From f4e22b1356637864fd06b4c6d9027f4580aabcc9 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Thu, 1 May 2008 04:58:15 +0000 Subject: * Fix OBB raycaster to respond properly to rays cast from any direction. --- OpenSim/Region/Environment/Scenes/Scene.cs | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) (limited to 'OpenSim/Region') diff --git a/OpenSim/Region/Environment/Scenes/Scene.cs b/OpenSim/Region/Environment/Scenes/Scene.cs index 2ce6314..b5ead2a 100644 --- a/OpenSim/Region/Environment/Scenes/Scene.cs +++ b/OpenSim/Region/Environment/Scenes/Scene.cs @@ -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; -- cgit v1.1