diff options
Diffstat (limited to 'OpenSim/Region/Physics/Manager/PhysicsScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/Manager/PhysicsScene.cs | 62 |
1 files changed, 61 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs index 9cdedbf..96ef0a6 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); |
@@ -146,9 +152,16 @@ namespace OpenSim.Region.Physics.Manager | |||
146 | /// <param name="size"></param> | 152 | /// <param name="size"></param> |
147 | /// <param name="isFlying"></param> | 153 | /// <param name="isFlying"></param> |
148 | /// <returns></returns> | 154 | /// <returns></returns> |
155 | <<<<<<< HEAD | ||
149 | public abstract PhysicsActor AddAvatar( | 156 | public abstract PhysicsActor AddAvatar( |
150 | string avName, Vector3 position, Vector3 velocity, Vector3 size, bool isFlying); | 157 | string avName, Vector3 position, Vector3 velocity, Vector3 size, bool isFlying); |
151 | 158 | ||
159 | ======= | ||
160 | public virtual PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying) | ||
161 | { | ||
162 | return null; | ||
163 | } | ||
164 | >>>>>>> avn/ubitvar | ||
152 | /// <summary> | 165 | /// <summary> |
153 | /// Add an avatar | 166 | /// Add an avatar |
154 | /// </summary> | 167 | /// </summary> |
@@ -170,6 +183,12 @@ namespace OpenSim.Region.Physics.Manager | |||
170 | return ret; | 183 | return ret; |
171 | } | 184 | } |
172 | 185 | ||
186 | public virtual PhysicsActor AddAvatar(uint localID, string avName, Vector3 position, Vector3 size, float feetOffset, bool isFlying) | ||
187 | { | ||
188 | PhysicsActor ret = AddAvatar(localID, avName, position, size, isFlying); | ||
189 | return ret; | ||
190 | } | ||
191 | |||
173 | /// <summary> | 192 | /// <summary> |
174 | /// Remove an avatar. | 193 | /// Remove an avatar. |
175 | /// </summary> | 194 | /// </summary> |
@@ -185,6 +204,19 @@ namespace OpenSim.Region.Physics.Manager | |||
185 | public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | 204 | public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, |
186 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid); | 205 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid); |
187 | 206 | ||
207 | public virtual PhysicsActor AddPrimShape(string primName, PhysicsActor parent, PrimitiveBaseShape pbs, Vector3 position, | ||
208 | uint localid, byte[] sdata) | ||
209 | { | ||
210 | return null; | ||
211 | } | ||
212 | |||
213 | public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
214 | Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, uint localid) | ||
215 | { | ||
216 | return AddPrimShape(primName, pbs, position, size, rotation, isPhysical, localid); | ||
217 | } | ||
218 | |||
219 | |||
188 | public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | 220 | public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, |
189 | Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, byte shapetype, uint localid) | 221 | Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, byte shapetype, uint localid) |
190 | { | 222 | { |
@@ -258,6 +290,9 @@ namespace OpenSim.Region.Physics.Manager | |||
258 | 290 | ||
259 | public abstract void AddPhysicsActorTaint(PhysicsActor prim); | 291 | public abstract void AddPhysicsActorTaint(PhysicsActor prim); |
260 | 292 | ||
293 | |||
294 | public virtual void PrepareSimulation() { } | ||
295 | |||
261 | /// <summary> | 296 | /// <summary> |
262 | /// Perform a simulation of the current physics scene over the given timestep. | 297 | /// Perform a simulation of the current physics scene over the given timestep. |
263 | /// </summary> | 298 | /// </summary> |
@@ -302,7 +337,7 @@ namespace OpenSim.Region.Physics.Manager | |||
302 | } | 337 | } |
303 | 338 | ||
304 | public virtual void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) {} | 339 | public virtual void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) {} |
305 | 340 | public virtual void CombineTerrain(float[] heightMap, Vector3 pOffset) {} | |
306 | public virtual void UnCombine(PhysicsScene pScene) {} | 341 | public virtual void UnCombine(PhysicsScene pScene) {} |
307 | 342 | ||
308 | /// <summary> | 343 | /// <summary> |
@@ -351,6 +386,31 @@ namespace OpenSim.Region.Physics.Manager | |||
351 | return false; | 386 | return false; |
352 | } | 387 | } |
353 | 388 | ||
389 | public virtual List<ContactResult> RaycastActor(PhysicsActor actor, Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags flags) | ||
390 | { | ||
391 | return new List<ContactResult>(); | ||
392 | } | ||
393 | |||
394 | public virtual List<ContactResult> BoxProbe(Vector3 position, Vector3 size, Quaternion orientation, int Count, RayFilterFlags flags) | ||
395 | { | ||
396 | return new List<ContactResult>(); | ||
397 | } | ||
398 | |||
399 | public virtual List<ContactResult> SphereProbe(Vector3 position, float radius, int Count, RayFilterFlags flags) | ||
400 | { | ||
401 | return new List<ContactResult>(); | ||
402 | } | ||
403 | |||
404 | public virtual List<ContactResult> PlaneProbe(PhysicsActor actor, Vector4 plane, int Count, RayFilterFlags flags) | ||
405 | { | ||
406 | return new List<ContactResult>(); | ||
407 | } | ||
408 | |||
409 | public virtual int SitAvatar(PhysicsActor actor, Vector3 AbsolutePosition, Vector3 CameraPosition, Vector3 offset, Vector3 AvatarSize, SitAvatarCallback PhysicsSitResponse) | ||
410 | { | ||
411 | return 0; | ||
412 | } | ||
413 | |||
354 | // Extendable interface for new, physics engine specific operations | 414 | // Extendable interface for new, physics engine specific operations |
355 | public virtual object Extension(string pFunct, params object[] pParams) | 415 | public virtual object Extension(string pFunct, params object[] pParams) |
356 | { | 416 | { |