aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Manager/PhysicsScene.cs
diff options
context:
space:
mode:
authorJustin Clark-Casey (justincc)2011-07-12 22:13:15 +0100
committerJustin Clark-Casey (justincc)2011-07-12 22:13:15 +0100
commit3e456163dd284fa04ab17465041a1a27f7b632b9 (patch)
treebaaa8a470f4afa7637e8919d41e161ec4215ce21 /OpenSim/Region/Physics/Manager/PhysicsScene.cs
parenttemporarily fix the build break with building the OdePlugin tests assembly. (diff)
downloadopensim-SC_OLD-3e456163dd284fa04ab17465041a1a27f7b632b9.zip
opensim-SC_OLD-3e456163dd284fa04ab17465041a1a27f7b632b9.tar.gz
opensim-SC_OLD-3e456163dd284fa04ab17465041a1a27f7b632b9.tar.bz2
opensim-SC_OLD-3e456163dd284fa04ab17465041a1a27f7b632b9.tar.xz
Port implementation of llCastRay() from Aurora.
I haven't been able to test this since the viewer won't parse the llCastRay() function. Maybe some activation cap is missing. Could wait until it is activated by default in the viewer.
Diffstat (limited to 'OpenSim/Region/Physics/Manager/PhysicsScene.cs')
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsScene.cs24
1 files changed, 23 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
index 13ea084..0de4626 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
@@ -37,6 +37,18 @@ namespace OpenSim.Region.Physics.Manager
37 public delegate void physicsCrash(); 37 public delegate void physicsCrash();
38 38
39 public delegate void RaycastCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal); 39 public delegate void RaycastCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal);
40 public delegate void RayCallback(List<ContactResult> list);
41
42 /// <summary>
43 /// Contact result from a raycast.
44 /// </summary>
45 public struct ContactResult
46 {
47 public Vector3 Pos;
48 public float Depth;
49 public uint ConsumerID;
50 public Vector3 Normal;
51 }
40 52
41 public abstract class PhysicsScene 53 public abstract class PhysicsScene
42 { 54 {
@@ -61,7 +73,6 @@ namespace OpenSim.Region.Physics.Manager
61 } 73 }
62 } 74 }
63 75
64
65 public abstract void Initialise(IMesher meshmerizer, IConfigSource config); 76 public abstract void Initialise(IMesher meshmerizer, IConfigSource config);
66 77
67 public abstract PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying); 78 public abstract PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying);
@@ -225,6 +236,17 @@ namespace OpenSim.Region.Physics.Manager
225 retMethod(false, Vector3.Zero, 0, 999999999999f, Vector3.Zero); 236 retMethod(false, Vector3.Zero, 0, 999999999999f, Vector3.Zero);
226 } 237 }
227 238
239 public virtual void RaycastWorld(Vector3 position, Vector3 direction, float length, int Count, RayCallback retMethod)
240 {
241 if (retMethod != null)
242 retMethod(new List<ContactResult>());
243 }
244
245 public virtual List<ContactResult> RaycastWorld(Vector3 position, Vector3 direction, float length, int Count)
246 {
247 return new List<ContactResult>();
248 }
249
228 private class NullPhysicsScene : PhysicsScene 250 private class NullPhysicsScene : PhysicsScene
229 { 251 {
230 private static int m_workIndicator; 252 private static int m_workIndicator;