aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs')
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs153
1 files changed, 0 insertions, 153 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
index 233267e..56f3786 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs
@@ -25,7 +25,6 @@
25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE. 25 * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26 */ 26 */
27 27
28//#define USE_DRAWSTUFF
29//#define SPAM 28//#define SPAM
30 29
31using System; 30using System;
@@ -38,9 +37,6 @@ using System.Diagnostics;
38using log4net; 37using log4net;
39using Nini.Config; 38using Nini.Config;
40using OdeAPI; 39using OdeAPI;
41#if USE_DRAWSTUFF
42using ODEDrawstuff;
43#endif
44using OpenSim.Framework; 40using OpenSim.Framework;
45using OpenSim.Region.Physics.Manager; 41using OpenSim.Region.Physics.Manager;
46using OpenMetaverse; 42using OpenMetaverse;
@@ -366,31 +362,11 @@ namespace OpenSim.Region.Physics.OdePlugin
366 //contactgroup 362 //contactgroup
367 363
368 d.WorldSetAutoDisableFlag(world, false); 364 d.WorldSetAutoDisableFlag(world, false);
369 #if USE_DRAWSTUFF
370
371 Thread viewthread = new Thread(new ParameterizedThreadStart(startvisualization));
372 viewthread.Start();
373 #endif
374 } 365 }
375 366
376 _watermap = new float[258 * 258]; 367 _watermap = new float[258 * 258];
377 } 368 }
378 369
379#if USE_DRAWSTUFF
380 public void startvisualization(object o)
381 {
382 ds.Functions fn;
383 fn.version = ds.VERSION;
384 fn.start = new ds.CallbackFunction(start);
385 fn.step = new ds.CallbackFunction(step);
386 fn.command = new ds.CallbackFunction(command);
387 fn.stop = null;
388 fn.path_to_textures = "./textures";
389 string[] args = new string[0];
390 ds.SimulationLoop(args.Length, args, 352, 288, ref fn);
391 }
392#endif
393
394 // Initialize the mesh plugin 370 // Initialize the mesh plugin
395// public override void Initialise(IMesher meshmerizer, IConfigSource config, RegionInfo region ) 371// public override void Initialise(IMesher meshmerizer, IConfigSource config, RegionInfo region )
396 public override void Initialise(IMesher meshmerizer, IConfigSource config) 372 public override void Initialise(IMesher meshmerizer, IConfigSource config)
@@ -2560,134 +2536,5 @@ namespace OpenSim.Region.Physics.OdePlugin
2560 } 2536 }
2561 return new List<ContactResult>(); 2537 return new List<ContactResult>();
2562 } 2538 }
2563
2564#if USE_DRAWSTUFF
2565 // Keyboard callback
2566 public void command(int cmd)
2567 {
2568 IntPtr geom;
2569 d.Mass mass;
2570 d.Vector3 sides = new d.Vector3(d.RandReal() * 0.5f + 0.1f, d.RandReal() * 0.5f + 0.1f, d.RandReal() * 0.5f + 0.1f);
2571
2572
2573
2574 Char ch = Char.ToLower((Char)cmd);
2575 switch ((Char)ch)
2576 {
2577 case 'w':
2578 try
2579 {
2580 Vector3 rotate = (new Vector3(1, 0, 0) * Quaternion.CreateFromEulers(hpr.Z * Utils.DEG_TO_RAD, hpr.Y * Utils.DEG_TO_RAD, hpr.X * Utils.DEG_TO_RAD));
2581
2582 xyz.X += rotate.X; xyz.Y += rotate.Y; xyz.Z += rotate.Z;
2583 ds.SetViewpoint(ref xyz, ref hpr);
2584 }
2585 catch (ArgumentException)
2586 { hpr.X = 0; }
2587 break;
2588
2589 case 'a':
2590 hpr.X++;
2591 ds.SetViewpoint(ref xyz, ref hpr);
2592 break;
2593
2594 case 's':
2595 try
2596 {
2597 Vector3 rotate2 = (new Vector3(-1, 0, 0) * Quaternion.CreateFromEulers(hpr.Z * Utils.DEG_TO_RAD, hpr.Y * Utils.DEG_TO_RAD, hpr.X * Utils.DEG_TO_RAD));
2598
2599 xyz.X += rotate2.X; xyz.Y += rotate2.Y; xyz.Z += rotate2.Z;
2600 ds.SetViewpoint(ref xyz, ref hpr);
2601 }
2602 catch (ArgumentException)
2603 { hpr.X = 0; }
2604 break;
2605 case 'd':
2606 hpr.X--;
2607 ds.SetViewpoint(ref xyz, ref hpr);
2608 break;
2609 case 'r':
2610 xyz.Z++;
2611 ds.SetViewpoint(ref xyz, ref hpr);
2612 break;
2613 case 'f':
2614 xyz.Z--;
2615 ds.SetViewpoint(ref xyz, ref hpr);
2616 break;
2617 case 'e':
2618 xyz.Y++;
2619 ds.SetViewpoint(ref xyz, ref hpr);
2620 break;
2621 case 'q':
2622 xyz.Y--;
2623 ds.SetViewpoint(ref xyz, ref hpr);
2624 break;
2625 }
2626 }
2627
2628 public void step(int pause)
2629 {
2630
2631 ds.SetColor(1.0f, 1.0f, 0.0f);
2632 ds.SetTexture(ds.Texture.Wood);
2633 lock (_prims)
2634 {
2635 foreach (OdePrim prm in _prims)
2636 {
2637 //IntPtr body = d.GeomGetBody(prm.prim_geom);
2638 if (prm.prim_geom != IntPtr.Zero)
2639 {
2640 d.Vector3 pos;
2641 d.GeomCopyPosition(prm.prim_geom, out pos);
2642 //d.BodyCopyPosition(body, out pos);
2643
2644 d.Matrix3 R;
2645 d.GeomCopyRotation(prm.prim_geom, out R);
2646 //d.BodyCopyRotation(body, out R);
2647
2648
2649 d.Vector3 sides = new d.Vector3();
2650 sides.X = prm.Size.X;
2651 sides.Y = prm.Size.Y;
2652 sides.Z = prm.Size.Z;
2653
2654 ds.DrawBox(ref pos, ref R, ref sides);
2655 }
2656 }
2657 }
2658 ds.SetColor(1.0f, 0.0f, 0.0f);
2659 lock (_characters)
2660 {
2661 foreach (OdeCharacter chr in _characters)
2662 {
2663 if (chr.Shell != IntPtr.Zero)
2664 {
2665 IntPtr body = d.GeomGetBody(chr.Shell);
2666
2667 d.Vector3 pos;
2668 d.GeomCopyPosition(chr.Shell, out pos);
2669 //d.BodyCopyPosition(body, out pos);
2670
2671 d.Matrix3 R;
2672 d.GeomCopyRotation(chr.Shell, out R);
2673 //d.BodyCopyRotation(body, out R);
2674
2675 ds.DrawCapsule(ref pos, ref R, chr.Size.Z, 0.35f);
2676 d.Vector3 sides = new d.Vector3();
2677 sides.X = 0.5f;
2678 sides.Y = 0.5f;
2679 sides.Z = 0.5f;
2680
2681 ds.DrawBox(ref pos, ref R, ref sides);
2682 }
2683 }
2684 }
2685 }
2686
2687 public void start(int unused)
2688 {
2689 ds.SetViewpoint(ref xyz, ref hpr);
2690 }
2691#endif
2692 } 2539 }
2693} 2540}