diff options
Diffstat (limited to 'OpenSim/Region/Physics/Manager/PhysicsScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/Manager/PhysicsScene.cs | 69 |
1 files changed, 68 insertions, 1 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs index 6a0558a..5274f3b 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; } |
@@ -241,7 +290,7 @@ namespace OpenSim.Region.Physics.Manager | |||
241 | } | 290 | } |
242 | 291 | ||
243 | public virtual void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) {} | 292 | public virtual void Combine(PhysicsScene pScene, Vector3 offset, Vector3 extents) {} |
244 | 293 | public virtual void CombineTerrain(float[] heightMap, Vector3 pOffset) {} | |
245 | public virtual void UnCombine(PhysicsScene pScene) {} | 294 | public virtual void UnCombine(PhysicsScene pScene) {} |
246 | 295 | ||
247 | /// <summary> | 296 | /// <summary> |
@@ -279,5 +328,23 @@ namespace OpenSim.Region.Physics.Manager | |||
279 | { | 328 | { |
280 | return new List<ContactResult>(); | 329 | return new List<ContactResult>(); |
281 | } | 330 | } |
331 | |||
332 | public virtual object RaycastWorld(Vector3 position, Vector3 direction, float length, int Count, RayFilterFlags filter) | ||
333 | { | ||
334 | return null; | ||
335 | } | ||
336 | |||
337 | public virtual bool SuportsRaycastWorldFiltered() | ||
338 | { | ||
339 | return false; | ||
340 | } | ||
341 | |||
342 | public virtual void RaycastActor(PhysicsActor actor, Vector3 position, Vector3 direction, float length, RaycastCallback retMethod){} | ||
343 | public virtual void RaycastActor(PhysicsActor actor, Vector3 position, Vector3 direction, float length, int Count, RayCallback retMethod) { } | ||
344 | public virtual List<ContactResult> RaycastActor(PhysicsActor actor, Vector3 position, Vector3 direction, float length, int Count) | ||
345 | { | ||
346 | return new List<ContactResult>(); | ||
347 | } | ||
348 | |||
282 | } | 349 | } |
283 | } | 350 | } |