diff options
Diffstat (limited to 'OpenSim/Region/Physics/Manager/PhysicsScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/Manager/PhysicsScene.cs | 39 |
1 files changed, 27 insertions, 12 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs index de22fae..72b01ac 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); |
@@ -75,6 +86,10 @@ namespace OpenSim.Region.Physics.Manager | |||
75 | 86 | ||
76 | public abstract void RemoveAvatar(PhysicsActor actor); | 87 | public abstract void RemoveAvatar(PhysicsActor actor); |
77 | 88 | ||
89 | /// <summary> | ||
90 | /// Remove a prim from the physics scene. | ||
91 | /// </summary> | ||
92 | /// <param name="prim"></param> | ||
78 | public abstract void RemovePrim(PhysicsActor prim); | 93 | public abstract void RemovePrim(PhysicsActor prim); |
79 | 94 | ||
80 | //public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | 95 | //public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, |
@@ -83,17 +98,6 @@ namespace OpenSim.Region.Physics.Manager | |||
83 | public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | 98 | public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, |
84 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid); | 99 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid); |
85 | 100 | ||
86 | public virtual PhysicsActor AddPrimShape(uint localID, string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
87 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid) | ||
88 | { | ||
89 | PhysicsActor ret = AddPrimShape(primName, pbs, position, size, rotation, isPhysical, localid); | ||
90 | |||
91 | if (ret != null) | ||
92 | ret.LocalID = localID; | ||
93 | |||
94 | return ret; | ||
95 | } | ||
96 | |||
97 | public virtual float TimeDilation | 101 | public virtual float TimeDilation |
98 | { | 102 | { |
99 | get { return 1.0f; } | 103 | get { return 1.0f; } |
@@ -226,6 +230,17 @@ namespace OpenSim.Region.Physics.Manager | |||
226 | retMethod(false, Vector3.Zero, 0, 999999999999f, Vector3.Zero); | 230 | retMethod(false, Vector3.Zero, 0, 999999999999f, Vector3.Zero); |
227 | } | 231 | } |
228 | 232 | ||
233 | public virtual void RaycastWorld(Vector3 position, Vector3 direction, float length, int Count, RayCallback retMethod) | ||
234 | { | ||
235 | if (retMethod != null) | ||
236 | retMethod(new List<ContactResult>()); | ||
237 | } | ||
238 | |||
239 | public virtual List<ContactResult> RaycastWorld(Vector3 position, Vector3 direction, float length, int Count) | ||
240 | { | ||
241 | return new List<ContactResult>(); | ||
242 | } | ||
243 | |||
229 | private class NullPhysicsScene : PhysicsScene | 244 | private class NullPhysicsScene : PhysicsScene |
230 | { | 245 | { |
231 | private static int m_workIndicator; | 246 | private static int m_workIndicator; |