aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs
diff options
context:
space:
mode:
authorMelanie2009-12-06 02:54:47 +0000
committerMelanie2009-12-06 02:54:47 +0000
commita44749b9d2d6b5295b4d642cae120c657e909f77 (patch)
tree5766467acf201af97884e934e33cea103d74c526 /OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs
parentExperimental: Remove explicit property sends (diff)
parent* Adds Normal to the fields returned by the Physics Raycaster (diff)
downloadopensim-SC_OLD-a44749b9d2d6b5295b4d642cae120c657e909f77.zip
opensim-SC_OLD-a44749b9d2d6b5295b4d642cae120c657e909f77.tar.gz
opensim-SC_OLD-a44749b9d2d6b5295b4d642cae120c657e909f77.tar.bz2
opensim-SC_OLD-a44749b9d2d6b5295b4d642cae120c657e909f77.tar.xz
Merge branch 'master' of melanie@opensimulator.org:/var/git/opensim
Diffstat (limited to 'OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs')
-rw-r--r--OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs10
1 files changed, 8 insertions, 2 deletions
diff --git a/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs b/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs
index c8ae229..732e835 100644
--- a/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs
+++ b/OpenSim/Region/Physics/OdePlugin/ODERayCastRequestManager.cs
@@ -145,6 +145,7 @@ namespace OpenSim.Region.Physics.OdePlugin
145 uint hitConsumerID = 0; 145 uint hitConsumerID = 0;
146 float distance = 999999999999f; 146 float distance = 999999999999f;
147 Vector3 closestcontact = new Vector3(99999f, 99999f, 99999f); 147 Vector3 closestcontact = new Vector3(99999f, 99999f, 99999f);
148 Vector3 snormal = Vector3.Zero;
148 149
149 // Find closest contact and object. 150 // Find closest contact and object.
150 lock (m_contactResults) 151 lock (m_contactResults)
@@ -157,6 +158,7 @@ namespace OpenSim.Region.Physics.OdePlugin
157 hitConsumerID = cResult.ConsumerID; 158 hitConsumerID = cResult.ConsumerID;
158 distance = cResult.Depth; 159 distance = cResult.Depth;
159 hitYN = true; 160 hitYN = true;
161 snormal = cResult.Normal;
160 } 162 }
161 } 163 }
162 164
@@ -165,7 +167,7 @@ namespace OpenSim.Region.Physics.OdePlugin
165 167
166 // Return results 168 // Return results
167 if (req.callbackMethod != null) 169 if (req.callbackMethod != null)
168 req.callbackMethod(hitYN, closestcontact, hitConsumerID, distance); 170 req.callbackMethod(hitYN, closestcontact, hitConsumerID, distance, snormal);
169 } 171 }
170 172
171 // This is the standard Near. Uses space AABBs to speed up detection. 173 // This is the standard Near. Uses space AABBs to speed up detection.
@@ -310,7 +312,8 @@ namespace OpenSim.Region.Physics.OdePlugin
310 collisionresult.ConsumerID = ((OdePrim)p1).m_localID; 312 collisionresult.ConsumerID = ((OdePrim)p1).m_localID;
311 collisionresult.Pos = new Vector3(contacts[i].pos.X, contacts[i].pos.Y, contacts[i].pos.Z); 313 collisionresult.Pos = new Vector3(contacts[i].pos.X, contacts[i].pos.Y, contacts[i].pos.Z);
312 collisionresult.Depth = contacts[i].depth; 314 collisionresult.Depth = contacts[i].depth;
313 315 collisionresult.Normal = new Vector3(contacts[i].normal.X, contacts[i].normal.Y,
316 contacts[i].normal.Z);
314 lock (m_contactResults) 317 lock (m_contactResults)
315 m_contactResults.Add(collisionresult); 318 m_contactResults.Add(collisionresult);
316 } 319 }
@@ -325,6 +328,8 @@ namespace OpenSim.Region.Physics.OdePlugin
325 collisionresult.ConsumerID = ((OdePrim)p2).m_localID; 328 collisionresult.ConsumerID = ((OdePrim)p2).m_localID;
326 collisionresult.Pos = new Vector3(contacts[i].pos.X, contacts[i].pos.Y, contacts[i].pos.Z); 329 collisionresult.Pos = new Vector3(contacts[i].pos.X, contacts[i].pos.Y, contacts[i].pos.Z);
327 collisionresult.Depth = contacts[i].depth; 330 collisionresult.Depth = contacts[i].depth;
331 collisionresult.Normal = new Vector3(contacts[i].normal.X, contacts[i].normal.Y,
332 contacts[i].normal.Z);
328 333
329 lock (m_contactResults) 334 lock (m_contactResults)
330 m_contactResults.Add(collisionresult); 335 m_contactResults.Add(collisionresult);
@@ -358,5 +363,6 @@ namespace OpenSim.Region.Physics.OdePlugin
358 public Vector3 Pos; 363 public Vector3 Pos;
359 public float Depth; 364 public float Depth;
360 public uint ConsumerID; 365 public uint ConsumerID;
366 public Vector3 Normal;
361 } 367 }
362} 368}