diff options
Diffstat (limited to 'OpenSim/Region/Physics/Manager/PhysicsScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/Manager/PhysicsScene.cs | 61 |
1 files changed, 58 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs index 07a1d36..52f2809 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs | |||
@@ -41,6 +41,10 @@ namespace OpenSim.Region.Physics.Manager | |||
41 | 41 | ||
42 | public delegate void RaycastCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal); | 42 | public delegate void RaycastCallback(bool hitYN, Vector3 collisionPoint, uint localid, float distance, Vector3 normal); |
43 | public delegate void RayCallback(List<ContactResult> list); | 43 | public delegate void RayCallback(List<ContactResult> list); |
44 | public delegate void ProbeBoxCallback(List<ContactResult> list); | ||
45 | public delegate void ProbeSphereCallback(List<ContactResult> list); | ||
46 | public delegate void ProbePlaneCallback(List<ContactResult> list); | ||
47 | public delegate void SitAvatarCallback(int status, uint partID, Vector3 offset, Quaternion Orientation); | ||
44 | 48 | ||
45 | public delegate void JointMoved(PhysicsJoint joint); | 49 | public delegate void JointMoved(PhysicsJoint joint); |
46 | public delegate void JointDeactivated(PhysicsJoint joint); | 50 | public delegate void JointDeactivated(PhysicsJoint joint); |
@@ -89,6 +93,8 @@ namespace OpenSim.Region.Physics.Manager | |||
89 | public Vector3 Normal; | 93 | public Vector3 Normal; |
90 | } | 94 | } |
91 | 95 | ||
96 | |||
97 | |||
92 | public abstract class PhysicsScene | 98 | public abstract class PhysicsScene |
93 | { | 99 | { |
94 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); | 100 | // private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); |
@@ -136,8 +142,10 @@ namespace OpenSim.Region.Physics.Manager | |||
136 | /// <param name="size"></param> | 142 | /// <param name="size"></param> |
137 | /// <param name="isFlying"></param> | 143 | /// <param name="isFlying"></param> |
138 | /// <returns></returns> | 144 | /// <returns></returns> |
139 | public abstract PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying); | 145 | public virtual PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying) |
140 | 146 | { | |
147 | return null; | ||
148 | } | ||
141 | /// <summary> | 149 | /// <summary> |
142 | /// Add an avatar | 150 | /// Add an avatar |
143 | /// </summary> | 151 | /// </summary> |
@@ -154,6 +162,12 @@ namespace OpenSim.Region.Physics.Manager | |||
154 | return ret; | 162 | return ret; |
155 | } | 163 | } |
156 | 164 | ||
165 | public virtual PhysicsActor AddAvatar(uint localID, string avName, Vector3 position, Vector3 size, float feetOffset, bool isFlying) | ||
166 | { | ||
167 | PhysicsActor ret = AddAvatar(localID, avName, position, size, isFlying); | ||
168 | return ret; | ||
169 | } | ||
170 | |||
157 | /// <summary> | 171 | /// <summary> |
158 | /// Remove an avatar. | 172 | /// Remove an avatar. |
159 | /// </summary> | 173 | /// </summary> |
@@ -169,6 +183,19 @@ namespace OpenSim.Region.Physics.Manager | |||
169 | public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | 183 | public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, |
170 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid); | 184 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid); |
171 | 185 | ||
186 | public virtual PhysicsActor AddPrimShape(string primName, PhysicsActor parent, PrimitiveBaseShape pbs, Vector3 position, | ||
187 | uint localid, byte[] sdata) | ||
188 | { | ||
189 | return null; | ||
190 | } | ||
191 | |||
192 | public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
193 | Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, uint localid) | ||
194 | { | ||
195 | return AddPrimShape(primName, pbs, position, size, rotation, isPhysical, localid); | ||
196 | } | ||
197 | |||
198 | |||
172 | public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | 199 | public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, |
173 | Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, byte shapetype, uint localid) | 200 | Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, byte shapetype, uint localid) |
174 | { | 201 | { |
@@ -242,6 +269,9 @@ namespace OpenSim.Region.Physics.Manager | |||
242 | 269 | ||
243 | public abstract void AddPhysicsActorTaint(PhysicsActor prim); | 270 | public abstract void AddPhysicsActorTaint(PhysicsActor prim); |
244 | 271 | ||
272 | |||
273 | public virtual void PrepareSimulation() { } | ||
274 | |||
245 | /// <summary> | 275 | /// <summary> |
246 | /// Perform a simulation of the current physics scene over the given timestep. | 276 | /// Perform a simulation of the current physics scene over the given timestep. |
247 | /// </summary> | 277 | /// </summary> |
@@ -286,7 +316,7 @@ namespace OpenSim.Region.Physics.Manager | |||
286 | } | 316 | } |
287 | 317 | ||
288 | public virtual void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) {} | 318 | public virtual void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) {} |
289 | 319 | public virtual void CombineTerrain(float[] heightMap, Vector3 pOffset) {} | |
290 | public virtual void UnCombine(PhysicsScene pScene) {} | 320 | public virtual void UnCombine(PhysicsScene pScene) {} |
291 | 321 | ||
292 | /// <summary> | 322 | /// <summary> |
@@ -335,6 +365,31 @@ namespace OpenSim.Region.Physics.Manager | |||
335 | return false; | 365 | return false; |
336 | } | 366 | } |
337 | 367 | ||
368 | public virtual List<ContactResult> RaycastActor(PhysicsActor actor, Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags flags) | ||
369 | { | ||
370 | return new List<ContactResult>(); | ||
371 | } | ||
372 | |||
373 | public virtual List<ContactResult> BoxProbe(Vector3 position, Vector3 size, Quaternion orientation, int Count, RayFilterFlags flags) | ||
374 | { | ||
375 | return new List<ContactResult>(); | ||
376 | } | ||
377 | |||
378 | public virtual List<ContactResult> SphereProbe(Vector3 position, float radius, int Count, RayFilterFlags flags) | ||
379 | { | ||
380 | return new List<ContactResult>(); | ||
381 | } | ||
382 | |||
383 | public virtual List<ContactResult> PlaneProbe(PhysicsActor actor, Vector4 plane, int Count, RayFilterFlags flags) | ||
384 | { | ||
385 | return new List<ContactResult>(); | ||
386 | } | ||
387 | |||
388 | public virtual int SitAvatar(PhysicsActor actor, Vector3 AbsolutePosition, Vector3 CameraPosition, Vector3 offset, Vector3 AvatarSize, SitAvatarCallback PhysicsSitResponse) | ||
389 | { | ||
390 | return 0; | ||
391 | } | ||
392 | |||
338 | // Extendable interface for new, physics engine specific operations | 393 | // Extendable interface for new, physics engine specific operations |
339 | public virtual object Extension(string pFunct, params object[] pParams) | 394 | public virtual object Extension(string pFunct, params object[] pParams) |
340 | { | 395 | { |