aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs66
1 files changed, 64 insertions, 2 deletions
diff --git a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs
index 32691fc..1c0ad20 100644
--- a/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs
+++ b/OpenSim/Region/PhysicsModules/SharedBase/PhysicsScene.cs
@@ -41,6 +41,10 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
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.PhysicsModules.SharedBase
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);
@@ -143,6 +149,7 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
143 /// <param name="size"></param> 149 /// <param name="size"></param>
144 /// <param name="isFlying"></param> 150 /// <param name="isFlying"></param>
145 /// <returns></returns> 151 /// <returns></returns>
152
146 public abstract PhysicsActor AddAvatar( 153 public abstract PhysicsActor AddAvatar(
147 string avName, Vector3 position, Vector3 velocity, Vector3 size, bool isFlying); 154 string avName, Vector3 position, Vector3 velocity, Vector3 size, bool isFlying);
148 155
@@ -161,12 +168,26 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
161 { 168 {
162 PhysicsActor ret = AddAvatar(avName, position, velocity, size, isFlying); 169 PhysicsActor ret = AddAvatar(avName, position, velocity, size, isFlying);
163 170
164 if (ret != null) 171 if (ret != null)
165 ret.LocalID = localID; 172 ret.LocalID = localID;
166 173
167 return ret; 174 return ret;
168 } 175 }
169 176
177 public virtual PhysicsActor AddAvatar(
178 uint localID, string avName, Vector3 position, Vector3 size, bool isFlying)
179 {
180 PhysicsActor ret = AddAvatar(localID, avName, position, Vector3.Zero, size, isFlying);
181 return ret;
182 }
183
184 public virtual PhysicsActor AddAvatar(
185 uint localID, string avName, Vector3 position, Vector3 size, float feetOffset, bool isFlying)
186 {
187 PhysicsActor ret = AddAvatar(localID, avName, position, Vector3.Zero, size, isFlying);
188 return ret;
189 }
190
170 /// <summary> 191 /// <summary>
171 /// Remove an avatar. 192 /// Remove an avatar.
172 /// </summary> 193 /// </summary>
@@ -182,6 +203,19 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
182 public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, 203 public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
183 Vector3 size, Quaternion rotation, bool isPhysical, uint localid); 204 Vector3 size, Quaternion rotation, bool isPhysical, uint localid);
184 205
206 public virtual PhysicsActor AddPrimShape(string primName, PhysicsActor parent, PrimitiveBaseShape pbs, Vector3 position,
207 uint localid, byte[] sdata)
208 {
209 return null;
210 }
211
212 public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
213 Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, uint localid)
214 {
215 return AddPrimShape(primName, pbs, position, size, rotation, isPhysical, localid);
216 }
217
218
185 public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, 219 public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
186 Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, byte shapetype, uint localid) 220 Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, byte shapetype, uint localid)
187 { 221 {
@@ -255,6 +289,9 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
255 289
256 public abstract void AddPhysicsActorTaint(PhysicsActor prim); 290 public abstract void AddPhysicsActorTaint(PhysicsActor prim);
257 291
292
293 public virtual void PrepareSimulation() { }
294
258 /// <summary> 295 /// <summary>
259 /// Perform a simulation of the current physics scene over the given timestep. 296 /// Perform a simulation of the current physics scene over the given timestep.
260 /// </summary> 297 /// </summary>
@@ -299,7 +336,7 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
299 } 336 }
300 337
301 public virtual void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) {} 338 public virtual void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) {}
302 339 public virtual void CombineTerrain(float[] heightMap, Vector3 pOffset) {}
303 public virtual void UnCombine(PhysicsScene pScene) {} 340 public virtual void UnCombine(PhysicsScene pScene) {}
304 341
305 /// <summary> 342 /// <summary>
@@ -348,6 +385,31 @@ namespace OpenSim.Region.PhysicsModules.SharedBase
348 return false; 385 return false;
349 } 386 }
350 387
388 public virtual List<ContactResult> RaycastActor(PhysicsActor actor, Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags flags)
389 {
390 return new List<ContactResult>();
391 }
392
393 public virtual List<ContactResult> BoxProbe(Vector3 position, Vector3 size, Quaternion orientation, int Count, RayFilterFlags flags)
394 {
395 return new List<ContactResult>();
396 }
397
398 public virtual List<ContactResult> SphereProbe(Vector3 position, float radius, int Count, RayFilterFlags flags)
399 {
400 return new List<ContactResult>();
401 }
402
403 public virtual List<ContactResult> PlaneProbe(PhysicsActor actor, Vector4 plane, int Count, RayFilterFlags flags)
404 {
405 return new List<ContactResult>();
406 }
407
408 public virtual int SitAvatar(PhysicsActor actor, Vector3 AbsolutePosition, Vector3 CameraPosition, Vector3 offset, Vector3 AvatarSize, SitAvatarCallback PhysicsSitResponse)
409 {
410 return 0;
411 }
412
351 // Extendable interface for new, physics engine specific operations 413 // Extendable interface for new, physics engine specific operations
352 public virtual object Extension(string pFunct, params object[] pParams) 414 public virtual object Extension(string pFunct, params object[] pParams)
353 { 415 {