diff options
author | Justin Clark-Casey (justincc) | 2011-10-14 01:38:14 +0100 |
---|---|---|
committer | Justin Clark-Casey (justincc) | 2011-10-14 01:38:14 +0100 |
commit | 77c65951e06c1d309f2bc8f6d2451b2b9a82c9df (patch) | |
tree | 8469539e3da2ac5691b24d8095a7645b1323d571 /OpenSim/Region/Physics/Manager/PhysicsScene.cs | |
parent | Don't execute rest of code in XEngine.RemoveRegion() and Close() if the modul... (diff) | |
download | opensim-SC-77c65951e06c1d309f2bc8f6d2451b2b9a82c9df.zip opensim-SC-77c65951e06c1d309f2bc8f6d2451b2b9a82c9df.tar.gz opensim-SC-77c65951e06c1d309f2bc8f6d2451b2b9a82c9df.tar.bz2 opensim-SC-77c65951e06c1d309f2bc8f6d2451b2b9a82c9df.tar.xz |
Extract NullPhysicsScene from PhysicsScene to improve code readability
Diffstat (limited to 'OpenSim/Region/Physics/Manager/PhysicsScene.cs')
-rw-r--r-- | OpenSim/Region/Physics/Manager/PhysicsScene.cs | 92 |
1 files changed, 4 insertions, 88 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs index 052ee9e..f1cc8e6 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs | |||
@@ -39,6 +39,10 @@ namespace OpenSim.Region.Physics.Manager | |||
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 | 41 | ||
42 | public delegate void JointMoved(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" | ||
45 | |||
42 | /// <summary> | 46 | /// <summary> |
43 | /// Contact result from a raycast. | 47 | /// Contact result from a raycast. |
44 | /// </summary> | 48 | /// </summary> |
@@ -258,93 +262,5 @@ namespace OpenSim.Region.Physics.Manager | |||
258 | { | 262 | { |
259 | return new List<ContactResult>(); | 263 | return new List<ContactResult>(); |
260 | } | 264 | } |
261 | |||
262 | private class NullPhysicsScene : PhysicsScene | ||
263 | { | ||
264 | private static int m_workIndicator; | ||
265 | |||
266 | |||
267 | public override void Initialise(IMesher meshmerizer, IConfigSource config) | ||
268 | { | ||
269 | // Does nothing right now | ||
270 | } | ||
271 | |||
272 | public override PhysicsActor AddAvatar(string avName, Vector3 position, Vector3 size, bool isFlying) | ||
273 | { | ||
274 | m_log.InfoFormat("[PHYSICS]: NullPhysicsScene : AddAvatar({0})", position); | ||
275 | return PhysicsActor.Null; | ||
276 | } | ||
277 | |||
278 | public override void RemoveAvatar(PhysicsActor actor) | ||
279 | { | ||
280 | } | ||
281 | |||
282 | public override void RemovePrim(PhysicsActor prim) | ||
283 | { | ||
284 | } | ||
285 | public override void SetWaterLevel(float baseheight) | ||
286 | { | ||
287 | |||
288 | } | ||
289 | |||
290 | /* | ||
291 | public override PhysicsActor AddPrim(Vector3 position, Vector3 size, Quaternion rotation) | ||
292 | { | ||
293 | m_log.InfoFormat("NullPhysicsScene : AddPrim({0},{1})", position, size); | ||
294 | return PhysicsActor.Null; | ||
295 | } | ||
296 | */ | ||
297 | |||
298 | public override PhysicsActor AddPrimShape(string primName, PrimitiveBaseShape pbs, Vector3 position, | ||
299 | Vector3 size, Quaternion rotation, bool isPhysical, uint localid) | ||
300 | { | ||
301 | m_log.InfoFormat("[PHYSICS]: NullPhysicsScene : AddPrim({0},{1})", position, size); | ||
302 | return PhysicsActor.Null; | ||
303 | } | ||
304 | |||
305 | public override void AddPhysicsActorTaint(PhysicsActor prim) | ||
306 | { | ||
307 | } | ||
308 | |||
309 | public override float Simulate(float timeStep) | ||
310 | { | ||
311 | m_workIndicator = (m_workIndicator + 1) % 10; | ||
312 | |||
313 | return 0f; | ||
314 | } | ||
315 | |||
316 | public override void GetResults() | ||
317 | { | ||
318 | m_log.Info("[PHYSICS]: NullPhysicsScene : GetResults()"); | ||
319 | } | ||
320 | |||
321 | public override void SetTerrain(float[] heightMap) | ||
322 | { | ||
323 | m_log.InfoFormat("[PHYSICS]: NullPhysicsScene : SetTerrain({0} items)", heightMap.Length); | ||
324 | } | ||
325 | |||
326 | public override void DeleteTerrain() | ||
327 | { | ||
328 | } | ||
329 | |||
330 | public override bool IsThreaded | ||
331 | { | ||
332 | get { return false; } | ||
333 | } | ||
334 | |||
335 | public override void Dispose() | ||
336 | { | ||
337 | } | ||
338 | |||
339 | public override Dictionary<uint,float> GetTopColliders() | ||
340 | { | ||
341 | Dictionary<uint, float> returncolliders = new Dictionary<uint, float>(); | ||
342 | return returncolliders; | ||
343 | } | ||
344 | |||
345 | } | ||
346 | } | 265 | } |
347 | public delegate void JointMoved(PhysicsJoint joint); | ||
348 | public delegate void JointDeactivated(PhysicsJoint joint); | ||
349 | public delegate void JointErrorMessage(PhysicsJoint joint, string message); // this refers to an "error message due to a problem", not "amount of joint constraint violation" | ||
350 | } | 266 | } |