From 3d1b4f8578e4dc3df0436c1c13f1b2983d3b55e7 Mon Sep 17 00:00:00 2001 From: Teravus Ovares Date: Tue, 25 Mar 2008 16:09:43 +0000 Subject: * On Ray casting. Now returning the face normal of the collision face. --- OpenSim/Region/Environment/Scenes/EntityBase.cs | 4 ++-- OpenSim/Region/Environment/Scenes/SceneObjectPart.cs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) (limited to 'OpenSim/Region/Environment/Scenes') diff --git a/OpenSim/Region/Environment/Scenes/EntityBase.cs b/OpenSim/Region/Environment/Scenes/EntityBase.cs index 713b205..c6a5b29 100644 --- a/OpenSim/Region/Environment/Scenes/EntityBase.cs +++ b/OpenSim/Region/Environment/Scenes/EntityBase.cs @@ -228,7 +228,7 @@ namespace OpenSim.Region.Environment.Scenes public class EntityIntersection { public Vector3 ipoint = new Vector3(0, 0, 0); - public float normal = 0; + public Vector3 normal = new Vector3(0, 0, 0); public bool HitTF = false; public SceneObjectPart obj; public float distance = 0; @@ -237,7 +237,7 @@ namespace OpenSim.Region.Environment.Scenes { } - public EntityIntersection(Vector3 _ipoint, float _normal, bool _HitTF) + public EntityIntersection(Vector3 _ipoint, Vector3 _normal, bool _HitTF) { ipoint = _ipoint; normal = _normal; diff --git a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs index 2c65a8f..acb2588 100644 --- a/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs +++ b/OpenSim/Region/Environment/Scenes/SceneObjectPart.cs @@ -953,7 +953,7 @@ namespace OpenSim.Region.Environment.Scenes // Normal is calculated by the difference and then normalizing the result Vector3 normalpart = ipoint - vAbsolutePosition; - returnresult.normal = normalpart.Normalize(); + returnresult.normal = normalpart / normalpart.Length; // It's funny how the LLVector3 object has a Distance function, but the Axiom.Math object doesnt. // I can write a function to do it.. but I like the fact that this one is Static. @@ -1261,7 +1261,7 @@ namespace OpenSim.Region.Environment.Scenes returnresult.HitTF = true; returnresult.ipoint = q; //m_log.Info("[POINT]: " + q.ToString()); - returnresult.normal = 1; + returnresult.normal = normals[i]; } } -- cgit v1.1