aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Manager/PhysicsScene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/Manager/PhysicsScene.cs')
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsScene.cs47
1 files changed, 25 insertions, 22 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
index 13ea084..3870411 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);
@@ -78,20 +89,7 @@ namespace OpenSim.Region.Physics.Manager
78 public abstract void RemovePrim(PhysicsActor prim); 89 public abstract void RemovePrim(PhysicsActor prim);
79 90
80 public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, 91 public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
81 Vector3 size, Quaternion rotation); //To be removed 92 Vector3 size, Quaternion rotation, bool isPhysical, uint localid);
82 public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
83 Vector3 size, Quaternion rotation, bool isPhysical);
84
85 public virtual PhysicsActor AddPrimShape(uint localID, string primName, PrimitiveBaseShape pbs, Vector3 position,
86 Vector3 size, Quaternion rotation, bool isPhysical)
87 {
88 PhysicsActor ret = AddPrimShape(primName, pbs, position, size, rotation, isPhysical);
89
90 if (ret != null)
91 ret.LocalID = localID;
92
93 return ret;
94 }
95 93
96 public virtual float TimeDilation 94 public virtual float TimeDilation
97 { 95 {
@@ -225,6 +223,17 @@ namespace OpenSim.Region.Physics.Manager
225 retMethod(false, Vector3.Zero, 0, 999999999999f, Vector3.Zero); 223 retMethod(false, Vector3.Zero, 0, 999999999999f, Vector3.Zero);
226 } 224 }
227 225
226 public virtual void RaycastWorld(Vector3 position, Vector3 direction, float length, int Count, RayCallback retMethod)
227 {
228 if (retMethod != null)
229 retMethod(new List<ContactResult>());
230 }
231
232 public virtual List<ContactResult> RaycastWorld(Vector3 position, Vector3 direction, float length, int Count)
233 {
234 return new List<ContactResult>();
235 }
236
228 private class NullPhysicsScene : PhysicsScene 237 private class NullPhysicsScene : PhysicsScene
229 { 238 {
230 private static int m_workIndicator; 239 private static int m_workIndicator;
@@ -262,13 +271,7 @@ namespace OpenSim.Region.Physics.Manager
262*/ 271*/
263 272
264 public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, 273 public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
265 Vector3 size, Quaternion rotation) //To be removed 274 Vector3 size, Quaternion rotation, bool isPhysical, uint localid)
266 {
267 return AddPrimShape(primName, pbs, position, size, rotation, false);
268 }
269
270 public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
271 Vector3 size, Quaternion rotation, bool isPhysical)
272 { 275 {
273 m_log.InfoFormat("[PHYSICS]: NullPhysicsScene : AddPrim({0},{1})", position, size); 276 m_log.InfoFormat("[PHYSICS]: NullPhysicsScene : AddPrim({0},{1})", position, size);
274 return PhysicsActor.Null; 277 return PhysicsActor.Null;