diff options
author | Jeff Ames | 2007-12-04 22:14:53 +0000 |
---|---|---|
committer | Jeff Ames | 2007-12-04 22:14:53 +0000 |
commit | f195725db447aad7595810a9950f656163bf1c13 (patch) | |
tree | 2d62dbd3635b008e9c41c2645fc71a6abbcc0a26 /OpenSim/Region/Physics | |
parent | made log messages for known unhandled packet types shorter and yellower. add... (diff) | |
download | opensim-SC_OLD-f195725db447aad7595810a9950f656163bf1c13.zip opensim-SC_OLD-f195725db447aad7595810a9950f656163bf1c13.tar.gz opensim-SC_OLD-f195725db447aad7595810a9950f656163bf1c13.tar.bz2 opensim-SC_OLD-f195725db447aad7595810a9950f656163bf1c13.tar.xz |
keeping opensim safe for children -- made some namespace references less explicit
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r-- | OpenSim/Region/Physics/Manager/PhysicsScene.cs | 2 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | 8 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | 22 | ||||
-rw-r--r-- | OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | 21 |
4 files changed, 19 insertions, 34 deletions
diff --git a/OpenSim/Region/Physics/Manager/PhysicsScene.cs b/OpenSim/Region/Physics/Manager/PhysicsScene.cs index 56a1842..5de22e7 100644 --- a/OpenSim/Region/Physics/Manager/PhysicsScene.cs +++ b/OpenSim/Region/Physics/Manager/PhysicsScene.cs | |||
@@ -130,7 +130,7 @@ namespace OpenSim.Region.Physics.Manager | |||
130 | { | 130 | { |
131 | m_workIndicator = (m_workIndicator + 1)%10; | 131 | m_workIndicator = (m_workIndicator + 1)%10; |
132 | 132 | ||
133 | //OpenSim.Framework.Console.MainLog.Instance.SetStatus(m_workIndicator.ToString()); | 133 | //MainLog.Instance.SetStatus(m_workIndicator.ToString()); |
134 | } | 134 | } |
135 | 135 | ||
136 | public override void GetResults() | 136 | public override void GetResults() |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs index 1e15f5e..91e44f3 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODECharacter.cs | |||
@@ -3,6 +3,7 @@ using System.Collections.Generic; | |||
3 | using Axiom.Math; | 3 | using Axiom.Math; |
4 | using Ode.NET; | 4 | using Ode.NET; |
5 | using OpenSim.Framework; | 5 | using OpenSim.Framework; |
6 | using OpenSim.Framework.Console; | ||
6 | using OpenSim.Region.Physics.Manager; | 7 | using OpenSim.Region.Physics.Manager; |
7 | 8 | ||
8 | namespace OpenSim.Region.Physics.OdePlugin | 9 | namespace OpenSim.Region.Physics.OdePlugin |
@@ -229,7 +230,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
229 | CAPSULE_LENGTH = (SetSize.Z - ((SetSize.Z * 0.43f))); // subtract 43% of the size | 230 | CAPSULE_LENGTH = (SetSize.Z - ((SetSize.Z * 0.43f))); // subtract 43% of the size |
230 | d.BodyDestroy(Body); | 231 | d.BodyDestroy(Body); |
231 | d.GeomDestroy(Shell); | 232 | d.GeomDestroy(Shell); |
232 | //OpenSim.Framework.Console.MainLog.Instance.Verbose("PHYSICS", "Set Avatar Height To: " + (CAPSULE_RADIUS + CAPSULE_LENGTH)); | 233 | //MainLog.Instance.Verbose("PHYSICS", "Set Avatar Height To: " + (CAPSULE_RADIUS + CAPSULE_LENGTH)); |
233 | Shell = d.CreateCapsule(_parent_scene.space, capsuleradius, CAPSULE_LENGTH); | 234 | Shell = d.CreateCapsule(_parent_scene.space, capsuleradius, CAPSULE_LENGTH); |
234 | d.MassSetCapsule(out ShellMass, 50.0f, 3, CAPSULE_RADIUS, CAPSULE_LENGTH); | 235 | d.MassSetCapsule(out ShellMass, 50.0f, 3, CAPSULE_RADIUS, CAPSULE_LENGTH); |
235 | Body = d.BodyCreate(_parent_scene.world); | 236 | Body = d.BodyCreate(_parent_scene.world); |
@@ -428,13 +429,12 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
428 | int[] arrayitem = _parent_scene.calculateSpaceArrayItemFromPos(_position); | 429 | int[] arrayitem = _parent_scene.calculateSpaceArrayItemFromPos(_position); |
429 | if (primScenAvatarIn == "0") | 430 | if (primScenAvatarIn == "0") |
430 | { | 431 | { |
431 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Avatar " + m_name + " in space with no prim. Arr:':" + arrayitem[0].ToString() + "," + arrayitem[1].ToString()); | 432 | MainLog.Instance.Verbose("Physics", "Avatar " + m_name + " in space with no prim. Arr:':" + arrayitem[0].ToString() + "," + arrayitem[1].ToString()); |
432 | } | 433 | } |
433 | else | 434 | else |
434 | { | 435 | { |
435 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Avatar " + m_name + " in Prim space':" + primScenAvatarIn + ". Arr:" + arrayitem[0].ToString() + "," + arrayitem[1].ToString()); | 436 | MainLog.Instance.Verbose("Physics", "Avatar " + m_name + " in Prim space':" + primScenAvatarIn + ". Arr:" + arrayitem[0].ToString() + "," + arrayitem[1].ToString()); |
436 | } | 437 | } |
437 | |||
438 | } | 438 | } |
439 | } | 439 | } |
440 | else | 440 | else |
diff --git a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs index 19de4ca..b81dba7 100644 --- a/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs +++ b/OpenSim/Region/Physics/OdePlugin/ODEPrim.cs | |||
@@ -3,6 +3,7 @@ using System.Collections.Generic; | |||
3 | using Axiom.Math; | 3 | using Axiom.Math; |
4 | using Ode.NET; | 4 | using Ode.NET; |
5 | using OpenSim.Framework; | 5 | using OpenSim.Framework; |
6 | using OpenSim.Framework.Console; | ||
6 | using OpenSim.Region.Physics.Manager; | 7 | using OpenSim.Region.Physics.Manager; |
7 | 8 | ||
8 | namespace OpenSim.Region.Physics.OdePlugin | 9 | namespace OpenSim.Region.Physics.OdePlugin |
@@ -47,12 +48,9 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
47 | private const float MassMultiplier = 150f; // Ref: Water: 1000kg.. this iset to 500 | 48 | private const float MassMultiplier = 150f; // Ref: Water: 1000kg.. this iset to 500 |
48 | private int debugcounter = 0; | 49 | private int debugcounter = 0; |
49 | 50 | ||
50 | |||
51 | public OdePrim(String primName, OdeScene parent_scene, IntPtr targetSpace, PhysicsVector pos, PhysicsVector size, | 51 | public OdePrim(String primName, OdeScene parent_scene, IntPtr targetSpace, PhysicsVector pos, PhysicsVector size, |
52 | Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical) | 52 | Quaternion rotation, IMesh mesh, PrimitiveBaseShape pbs, bool pisPhysical) |
53 | { | 53 | { |
54 | |||
55 | |||
56 | _velocity = new PhysicsVector(); | 54 | _velocity = new PhysicsVector(); |
57 | _position = pos; | 55 | _position = pos; |
58 | m_taintposition = pos; | 56 | m_taintposition = pos; |
@@ -98,8 +96,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
98 | } | 96 | } |
99 | m_primName = primName; | 97 | m_primName = primName; |
100 | 98 | ||
101 | |||
102 | |||
103 | lock (OdeScene.OdeLock) | 99 | lock (OdeScene.OdeLock) |
104 | { | 100 | { |
105 | if (mesh != null) | 101 | if (mesh != null) |
@@ -243,11 +239,11 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
243 | int[] arrayitem = _parent_scene.calculateSpaceArrayItemFromPos(_position); | 239 | int[] arrayitem = _parent_scene.calculateSpaceArrayItemFromPos(_position); |
244 | if (primScenAvatarIn == "0") | 240 | if (primScenAvatarIn == "0") |
245 | { | 241 | { |
246 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Prim " + m_primName + " in space with no prim: " + primScenAvatarIn + ". Expected to be at: " + m_targetSpace.ToString() + " . Arr:': " + arrayitem[0].ToString() + "," + arrayitem[1].ToString()); | 242 | MainLog.Instance.Verbose("Physics", "Prim " + m_primName + " in space with no prim: " + primScenAvatarIn + ". Expected to be at: " + m_targetSpace.ToString() + " . Arr:': " + arrayitem[0].ToString() + "," + arrayitem[1].ToString()); |
247 | } | 243 | } |
248 | else | 244 | else |
249 | { | 245 | { |
250 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Prim " + m_primName + " in Prim space with prim: " + primScenAvatarIn + ". Expected to be at: " + m_targetSpace.ToString() + ". Arr:" + arrayitem[0].ToString() + "," + arrayitem[1].ToString()); | 246 | MainLog.Instance.Verbose("Physics", "Prim " + m_primName + " in Prim space with prim: " + primScenAvatarIn + ". Expected to be at: " + m_targetSpace.ToString() + ". Arr:" + arrayitem[0].ToString() + "," + arrayitem[1].ToString()); |
251 | } | 247 | } |
252 | m_targetSpace = _parent_scene.recalculateSpaceForGeom(prim_geom, _position, m_targetSpace); | 248 | m_targetSpace = _parent_scene.recalculateSpaceForGeom(prim_geom, _position, m_targetSpace); |
253 | d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); | 249 | d.GeomSetPosition(prim_geom, _position.X, _position.Y, _position.Z); |
@@ -361,13 +357,10 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
361 | enableBody(); | 357 | enableBody(); |
362 | d.BodyEnable(Body); | 358 | d.BodyEnable(Body); |
363 | } | 359 | } |
364 | |||
365 | } | 360 | } |
366 | 361 | ||
367 | |||
368 | _parent_scene.geom_name_map[prim_geom] = oldname; | 362 | _parent_scene.geom_name_map[prim_geom] = oldname; |
369 | 363 | ||
370 | |||
371 | m_taintsize = _size; | 364 | m_taintsize = _size; |
372 | } | 365 | } |
373 | public void changeshape(float timestamp) | 366 | public void changeshape(float timestamp) |
@@ -382,9 +375,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
382 | d.GeomDestroy(prim_geom); | 375 | d.GeomDestroy(prim_geom); |
383 | if (_mesh != null) | 376 | if (_mesh != null) |
384 | { | 377 | { |
385 | |||
386 | d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z); | 378 | d.GeomBoxSetLengths(prim_geom, _size.X, _size.Y, _size.Z); |
387 | |||
388 | } | 379 | } |
389 | 380 | ||
390 | // Construction of new prim | 381 | // Construction of new prim |
@@ -421,9 +412,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
421 | } | 412 | } |
422 | _parent_scene.geom_name_map[prim_geom] = oldname; | 413 | _parent_scene.geom_name_map[prim_geom] = oldname; |
423 | 414 | ||
424 | |||
425 | |||
426 | |||
427 | m_taintshape = false; | 415 | m_taintshape = false; |
428 | } | 416 | } |
429 | public override bool IsPhysical | 417 | public override bool IsPhysical |
@@ -470,7 +458,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
470 | { | 458 | { |
471 | get { return _position; } | 459 | get { return _position; } |
472 | 460 | ||
473 | |||
474 | set | 461 | set |
475 | { | 462 | { |
476 | _position = value; | 463 | _position = value; |
@@ -484,7 +471,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
484 | set | 471 | set |
485 | { | 472 | { |
486 | _size = value; | 473 | _size = value; |
487 | |||
488 | } | 474 | } |
489 | } | 475 | } |
490 | 476 | ||
@@ -493,7 +479,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
493 | set | 479 | set |
494 | { | 480 | { |
495 | _pbs = value; | 481 | _pbs = value; |
496 | |||
497 | } | 482 | } |
498 | } | 483 | } |
499 | 484 | ||
@@ -634,7 +619,6 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
634 | base.RequestPhysicsterseUpdate(); | 619 | base.RequestPhysicsterseUpdate(); |
635 | m_lastUpdateSent = true; | 620 | m_lastUpdateSent = true; |
636 | } | 621 | } |
637 | |||
638 | } | 622 | } |
639 | else | 623 | else |
640 | { | 624 | { |
diff --git a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs index 1e05274..845d4f9 100644 --- a/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs +++ b/OpenSim/Region/Physics/OdePlugin/OdePlugin.cs | |||
@@ -31,6 +31,7 @@ using System.Collections.Generic; | |||
31 | using Axiom.Math; | 31 | using Axiom.Math; |
32 | using Ode.NET; | 32 | using Ode.NET; |
33 | using OpenSim.Framework; | 33 | using OpenSim.Framework; |
34 | using OpenSim.Framework.Console; | ||
34 | using OpenSim.Region.Physics.Manager; | 35 | using OpenSim.Region.Physics.Manager; |
35 | 36 | ||
36 | //using OpenSim.Region.Physics.OdePlugin.Meshing; | 37 | //using OpenSim.Region.Physics.OdePlugin.Meshing; |
@@ -242,7 +243,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
242 | } | 243 | } |
243 | catch (System.Runtime.InteropServices.SEHException) | 244 | catch (System.Runtime.InteropServices.SEHException) |
244 | { | 245 | { |
245 | OpenSim.Framework.Console.MainLog.Instance.Error("PHYSICS", "The Operating system shut down ODE because of corrupt memory. This could be a result of really irregular terrain. If this repeats continuously, restart using Basic Physics and terrain fill your terrain. Restarting the sim."); | 246 | MainLog.Instance.Error("PHYSICS", "The Operating system shut down ODE because of corrupt memory. This could be a result of really irregular terrain. If this repeats continuously, restart using Basic Physics and terrain fill your terrain. Restarting the sim."); |
246 | base.TriggerPhysicsBasedRestart(); | 247 | base.TriggerPhysicsBasedRestart(); |
247 | } | 248 | } |
248 | 249 | ||
@@ -438,7 +439,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
438 | } | 439 | } |
439 | else | 440 | else |
440 | { | 441 | { |
441 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'removeprim from scene':" + ((OdePrim)prim).m_targetSpace.ToString()); | 442 | MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'removeprim from scene':" + ((OdePrim)prim).m_targetSpace.ToString()); |
442 | } | 443 | } |
443 | } | 444 | } |
444 | } | 445 | } |
@@ -460,7 +461,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
460 | } | 461 | } |
461 | else | 462 | else |
462 | { | 463 | { |
463 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'removeprim from scene':" + ((OdePrim)prim).m_targetSpace.ToString()); | 464 | MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'removeprim from scene':" + ((OdePrim)prim).m_targetSpace.ToString()); |
464 | } | 465 | } |
465 | } | 466 | } |
466 | } | 467 | } |
@@ -508,7 +509,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
508 | } | 509 | } |
509 | else | 510 | else |
510 | { | 511 | { |
511 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'recalculatespace':" + currentspace.ToString() + " Geom:" + geom.ToString()); | 512 | MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'recalculatespace':" + currentspace.ToString() + " Geom:" + geom.ToString()); |
512 | } | 513 | } |
513 | } | 514 | } |
514 | else | 515 | else |
@@ -523,7 +524,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
523 | } | 524 | } |
524 | else | 525 | else |
525 | { | 526 | { |
526 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'recalculatespace':" + sGeomIsIn.ToString() + " Geom:" + geom.ToString()); | 527 | MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'recalculatespace':" + sGeomIsIn.ToString() + " Geom:" + geom.ToString()); |
527 | } | 528 | } |
528 | } | 529 | } |
529 | } | 530 | } |
@@ -543,7 +544,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
543 | } | 544 | } |
544 | else | 545 | else |
545 | { | 546 | { |
546 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'recalculatespace':" + currentspace.ToString() + " Geom:" + geom.ToString()); | 547 | MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'recalculatespace':" + currentspace.ToString() + " Geom:" + geom.ToString()); |
547 | } | 548 | } |
548 | 549 | ||
549 | } | 550 | } |
@@ -561,7 +562,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
561 | } | 562 | } |
562 | else | 563 | else |
563 | { | 564 | { |
564 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'recalculatespace':" + currentspace.ToString() + " Geom:" + geom.ToString()); | 565 | MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'recalculatespace':" + currentspace.ToString() + " Geom:" + geom.ToString()); |
565 | 566 | ||
566 | } | 567 | } |
567 | } | 568 | } |
@@ -578,7 +579,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
578 | } | 579 | } |
579 | else | 580 | else |
580 | { | 581 | { |
581 | OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'recalculatespace':" + sGeomIsIn.ToString() + " Geom:" + geom.ToString()); | 582 | MainLog.Instance.Verbose("Physics", "Invalid Scene passed to 'recalculatespace':" + sGeomIsIn.ToString() + " Geom:" + geom.ToString()); |
582 | 583 | ||
583 | } | 584 | } |
584 | } | 585 | } |
@@ -612,7 +613,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
612 | public IntPtr calculateSpaceForGeom(PhysicsVector pos) | 613 | public IntPtr calculateSpaceForGeom(PhysicsVector pos) |
613 | { | 614 | { |
614 | int[] xyspace = calculateSpaceArrayItemFromPos(pos); | 615 | int[] xyspace = calculateSpaceArrayItemFromPos(pos); |
615 | //OpenSim.Framework.Console.MainLog.Instance.Verbose("Physics", "Attempting to use arrayItem: " + xyspace[0].ToString() + "," + xyspace[1].ToString()); | 616 | //MainLog.Instance.Verbose("Physics", "Attempting to use arrayItem: " + xyspace[0].ToString() + "," + xyspace[1].ToString()); |
616 | IntPtr locationbasedspace = staticPrimspace[xyspace[0],xyspace[1]]; | 617 | IntPtr locationbasedspace = staticPrimspace[xyspace[0],xyspace[1]]; |
617 | 618 | ||
618 | //locationbasedspace = space; | 619 | //locationbasedspace = space; |
@@ -818,7 +819,7 @@ namespace OpenSim.Region.Physics.OdePlugin | |||
818 | } | 819 | } |
819 | catch (System.StackOverflowException) | 820 | catch (System.StackOverflowException) |
820 | { | 821 | { |
821 | OpenSim.Framework.Console.MainLog.Instance.Error("PHYSICS", "The operating system wasn't able to allocate enough memory for the simulation. Restarting the sim."); | 822 | MainLog.Instance.Error("PHYSICS", "The operating system wasn't able to allocate enough memory for the simulation. Restarting the sim."); |
822 | base.TriggerPhysicsBasedRestart(); | 823 | base.TriggerPhysicsBasedRestart(); |
823 | } | 824 | } |
824 | 825 | ||