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.cs61
1 files changed, 58 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
index 290b72e..20a70b4 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
@@ -38,6 +38,10 @@ namespace OpenSim.Region.Physics.Manager
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); 40 public delegate void RayCallback(List<ContactResult> list);
41 public delegate void ProbeBoxCallback(List<ContactResult> list);
42 public delegate void ProbeSphereCallback(List<ContactResult> list);
43 public delegate void ProbePlaneCallback(List<ContactResult> list);
44 public delegate void SitAvatarCallback(int status, uint partID, Vector3 offset, Quaternion Orientation);
41 45
42 public delegate void JointMoved(PhysicsJoint joint); 46 public delegate void JointMoved(PhysicsJoint joint);
43 public delegate void JointDeactivated(PhysicsJoint joint); 47 public delegate void JointDeactivated(PhysicsJoint joint);
@@ -86,6 +90,8 @@ namespace OpenSim.Region.Physics.Manager
86 public Vector3 Normal; 90 public Vector3 Normal;
87 } 91 }
88 92
93
94
89 public abstract class PhysicsScene 95 public abstract class PhysicsScene
90 { 96 {
91// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 97// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -133,8 +139,10 @@ namespace OpenSim.Region.Physics.Manager
133 /// <param name="size"></param> 139 /// <param name="size"></param>
134 /// <param name="isFlying"></param> 140 /// <param name="isFlying"></param>
135 /// <returns></returns> 141 /// <returns></returns>
136 public abstract PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying); 142 public virtual PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying)
137 143 {
144 return null;
145 }
138 /// <summary> 146 /// <summary>
139 /// Add an avatar 147 /// Add an avatar
140 /// </summary> 148 /// </summary>
@@ -151,6 +159,12 @@ namespace OpenSim.Region.Physics.Manager
151 return ret; 159 return ret;
152 } 160 }
153 161
162 public virtual PhysicsActor AddAvatar(uint localID, string avName, Vector3 position, Vector3 size, float feetOffset, bool isFlying)
163 {
164 PhysicsActor ret = AddAvatar(localID, avName, position, size, isFlying);
165 return ret;
166 }
167
154 /// <summary> 168 /// <summary>
155 /// Remove an avatar. 169 /// Remove an avatar.
156 /// </summary> 170 /// </summary>
@@ -166,6 +180,19 @@ namespace OpenSim.Region.Physics.Manager
166 public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, 180 public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
167 Vector3 size, Quaternion rotation, bool isPhysical, uint localid); 181 Vector3 size, Quaternion rotation, bool isPhysical, uint localid);
168 182
183 public virtual PhysicsActor AddPrimShape(string primName, PhysicsActor parent, PrimitiveBaseShape pbs, Vector3 position,
184 uint localid, byte[] sdata)
185 {
186 return null;
187 }
188
189 public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
190 Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, uint localid)
191 {
192 return AddPrimShape(primName, pbs, position, size, rotation, isPhysical, localid);
193 }
194
195
169 public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, 196 public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
170 Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, byte shapetype, uint localid) 197 Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, byte shapetype, uint localid)
171 { 198 {
@@ -239,6 +266,9 @@ namespace OpenSim.Region.Physics.Manager
239 266
240 public abstract void AddPhysicsActorTaint(PhysicsActor prim); 267 public abstract void AddPhysicsActorTaint(PhysicsActor prim);
241 268
269
270 public virtual void PrepareSimulation() { }
271
242 /// <summary> 272 /// <summary>
243 /// Perform a simulation of the current physics scene over the given timestep. 273 /// Perform a simulation of the current physics scene over the given timestep.
244 /// </summary> 274 /// </summary>
@@ -283,7 +313,7 @@ namespace OpenSim.Region.Physics.Manager
283 } 313 }
284 314
285 public virtual void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) {} 315 public virtual void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) {}
286 316 public virtual void CombineTerrain(float[] heightMap, Vector3 pOffset) {}
287 public virtual void UnCombine(PhysicsScene pScene) {} 317 public virtual void UnCombine(PhysicsScene pScene) {}
288 318
289 /// <summary> 319 /// <summary>
@@ -331,5 +361,30 @@ namespace OpenSim.Region.Physics.Manager
331 { 361 {
332 return false; 362 return false;
333 } 363 }
364
365 public virtual List<ContactResult> RaycastActor(PhysicsActor actor, Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags flags)
366 {
367 return new List<ContactResult>();
368 }
369
370 public virtual List<ContactResult> BoxProbe(Vector3 position, Vector3 size, Quaternion orientation, int Count, RayFilterFlags flags)
371 {
372 return new List<ContactResult>();
373 }
374
375 public virtual List<ContactResult> SphereProbe(Vector3 position, float radius, int Count, RayFilterFlags flags)
376 {
377 return new List<ContactResult>();
378 }
379
380 public virtual List<ContactResult> PlaneProbe(PhysicsActor actor, Vector4 plane, int Count, RayFilterFlags flags)
381 {
382 return new List<ContactResult>();
383 }
384
385 public virtual int SitAvatar(PhysicsActor actor, Vector3 AbsolutePosition, Vector3 CameraPosition, Vector3 offset, Vector3 AvatarSize, SitAvatarCallback PhysicsSitResponse)
386 {
387 return 0;
388 }
334 } 389 }
335} 390}