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.cs67
1 files changed, 64 insertions, 3 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
index 96a9ff7..fe418d3 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,25 @@ 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
196 public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
197 Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, byte shapetype, uint localid)
198 {
199 return AddPrimShape(primName, pbs, position, size, rotation, isPhysical, localid);
200 }
201
169 public virtual float TimeDilation 202 public virtual float TimeDilation
170 { 203 {
171 get { return 1.0f; } 204 get { return 1.0f; }
@@ -233,6 +266,9 @@ namespace OpenSim.Region.Physics.Manager
233 266
234 public abstract void AddPhysicsActorTaint(PhysicsActor prim); 267 public abstract void AddPhysicsActorTaint(PhysicsActor prim);
235 268
269
270 public virtual void PrepareSimulation() { }
271
236 /// <summary> 272 /// <summary>
237 /// 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.
238 /// </summary> 274 /// </summary>
@@ -277,7 +313,7 @@ namespace OpenSim.Region.Physics.Manager
277 } 313 }
278 314
279 public virtual void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) {} 315 public virtual void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) {}
280 316 public virtual void CombineTerrain(float[] heightMap, Vector3 pOffset) {}
281 public virtual void UnCombine(PhysicsScene pScene) {} 317 public virtual void UnCombine(PhysicsScene pScene) {}
282 318
283 /// <summary> 319 /// <summary>
@@ -325,5 +361,30 @@ namespace OpenSim.Region.Physics.Manager
325 { 361 {
326 return false; 362 return false;
327 } 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 }
328 } 389 }
329} 390}