aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/Manager/PhysicsScene.cs
diff options
context:
space:
mode:
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/Manager/PhysicsScene.cs72
1 files changed, 71 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
index 488900e..ce269fa 100644
--- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs
+++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs
@@ -43,6 +43,34 @@ namespace OpenSim.Region.Physics.Manager
43 public delegate void JointDeactivated(PhysicsJoint joint); 43 public delegate void JointDeactivated(PhysicsJoint joint);
44 public delegate void JointErrorMessage(PhysicsJoint joint, string message); // this refers to an "error message due to a problem", not "amount of joint constraint violation" 44 public delegate void JointErrorMessage(PhysicsJoint joint, string message); // this refers to an "error message due to a problem", not "amount of joint constraint violation"
45 45
46 public enum RayFilterFlags:ushort
47 {
48 // the flags
49 water = 0x01,
50 land = 0x02,
51 agent = 0x04,
52 nonphysical = 0x08,
53 physical = 0x10,
54 phantom = 0x20,
55 volumedtc = 0x40,
56
57 // ray cast colision control (may only work for meshs)
58 BackFaceCull = 0x4000,
59 ClosestHit = 0x8000,
60
61 // some combinations
62 LSLPhanton = phantom | volumedtc,
63 PrimsNonPhantom = nonphysical | physical,
64 PrimsNonPhantomAgents = nonphysical | physical | agent,
65
66 AllPrims = nonphysical | phantom | volumedtc | physical,
67 AllButLand = agent | nonphysical | physical | phantom | volumedtc,
68
69 ClosestAndBackCull = ClosestHit | BackFaceCull,
70
71 All = 0x3f
72 }
73
46 public delegate void RequestAssetDelegate(UUID assetID, AssetReceivedDelegate callback); 74 public delegate void RequestAssetDelegate(UUID assetID, AssetReceivedDelegate callback);
47 public delegate void AssetReceivedDelegate(AssetBase asset); 75 public delegate void AssetReceivedDelegate(AssetBase asset);
48 76
@@ -57,6 +85,8 @@ namespace OpenSim.Region.Physics.Manager
57 public Vector3 Normal; 85 public Vector3 Normal;
58 } 86 }
59 87
88
89
60 public abstract class PhysicsScene 90 public abstract class PhysicsScene
61 { 91 {
62// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType); 92// private static readonly ILog m_log = LogManager.GetLogger(MethodBase.GetCurrentMethod().DeclaringType);
@@ -130,6 +160,25 @@ namespace OpenSim.Region.Physics.Manager
130 public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, 160 public abstract PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
131 Vector3 size, Quaternion rotation, bool isPhysical, uint localid); 161 Vector3 size, Quaternion rotation, bool isPhysical, uint localid);
132 162
163 public virtual PhysicsActor AddPrimShape(string primName, PhysicsActor parent, PrimitiveBaseShape pbs, Vector3 position,
164 uint localid, byte[] sdata)
165 {
166 return null;
167 }
168
169 public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
170 Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, uint localid)
171 {
172 return AddPrimShape(primName, pbs, position, size, rotation, isPhysical, localid);
173 }
174
175
176 public virtual PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position,
177 Vector3 size, Quaternion rotation, bool isPhysical, bool isPhantom, byte shapetype, uint localid)
178 {
179 return AddPrimShape(primName, pbs, position, size, rotation, isPhysical, localid);
180 }
181
133 public virtual float TimeDilation 182 public virtual float TimeDilation
134 { 183 {
135 get { return 1.0f; } 184 get { return 1.0f; }
@@ -197,6 +246,9 @@ namespace OpenSim.Region.Physics.Manager
197 246
198 public abstract void AddPhysicsActorTaint(PhysicsActor prim); 247 public abstract void AddPhysicsActorTaint(PhysicsActor prim);
199 248
249
250 public virtual void PrepareSimulation() { }
251
200 /// <summary> 252 /// <summary>
201 /// Perform a simulation of the current physics scene over the given timestep. 253 /// Perform a simulation of the current physics scene over the given timestep.
202 /// </summary> 254 /// </summary>
@@ -241,7 +293,7 @@ namespace OpenSim.Region.Physics.Manager
241 } 293 }
242 294
243 public virtual void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) {} 295 public virtual void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) {}
244 296 public virtual void CombineTerrain(float[] heightMap, Vector3 pOffset) {}
245 public virtual void UnCombine(PhysicsScene pScene) {} 297 public virtual void UnCombine(PhysicsScene pScene) {}
246 298
247 /// <summary> 299 /// <summary>
@@ -279,5 +331,23 @@ namespace OpenSim.Region.Physics.Manager
279 { 331 {
280 return new List<ContactResult>(); 332 return new List<ContactResult>();
281 } 333 }
334
335 public virtual object RaycastWorld(Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags filter)
336 {
337 return null;
338 }
339
340 public virtual bool SuportsRaycastWorldFiltered()
341 {
342 return false;
343 }
344
345 public virtual void RaycastActor(PhysicsActor actor, Vector3 position, Vector3 direction, float length, RaycastCallback retMethod){}
346 public virtual void RaycastActor(PhysicsActor actor, Vector3 position, Vector3 direction, float length, int Count, RayCallback retMethod) { }
347 public virtual List<ContactResult> RaycastActor(PhysicsActor actor, Vector3 position, Vector3 direction, float length, int Count)
348 {
349 return new List<ContactResult>();
350 }
351
282 } 352 }
283} 353}