aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics
diff options
context:
space:
mode:
Diffstat (limited to 'OpenSim/Region/Physics')
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs2
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs3
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/OdeScene.cs153
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/drawstuff.cs99
4 files changed, 1 insertions, 256 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
index cf7fdca..793e281 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/ODECharacter.cs
@@ -126,7 +126,7 @@ namespace OpenSim.Region.Physics.OdePlugin
126 public IntPtr Shell = IntPtr.Zero; 126 public IntPtr Shell = IntPtr.Zero;
127 public IntPtr Amotor = IntPtr.Zero; 127 public IntPtr Amotor = IntPtr.Zero;
128 public d.Mass ShellMass; 128 public d.Mass ShellMass;
129 public bool collidelock = false; 129// public bool collidelock = false;
130 130
131 private bool m_haseventsubscription = false; 131 private bool m_haseventsubscription = false;
132 public int m_eventsubscription = 0; 132 public int m_eventsubscription = 0;
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
index 078adeb..3b7f562 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/ODEPrim.cs
@@ -2025,9 +2025,6 @@ namespace OpenSim.Region.Physics.OdePlugin
2025 SetInStaticSpace(this); 2025 SetInStaticSpace(this);
2026 } 2026 }
2027 2027
2028 // m_building = false; // REMOVE THIS LATER
2029
2030
2031 if (m_isphysical && Body == IntPtr.Zero) 2028 if (m_isphysical && Body == IntPtr.Zero)
2032 { 2029 {
2033 /* 2030 /*
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}
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/drawstuff.cs b/OpenSim/Region/Physics/UbitOdePlugin/drawstuff.cs
deleted file mode 100644
index aefad3a..0000000
--- a/OpenSim/Region/Physics/UbitOdePlugin/drawstuff.cs
+++ /dev/null
@@ -1,99 +0,0 @@
1/*
2 * Copyright ODE
3 * Ode.NET - .NET bindings for ODE
4 * Jason Perkins (starkos@industriousone.com)
5 * Licensed under the New BSD
6 * Part of the OpenDynamicsEngine
7Open Dynamics Engine
8Copyright (c) 2001-2007, Russell L. Smith.
9All rights reserved.
10
11Redistribution and use in source and binary forms, with or without
12modification, are permitted provided that the following conditions
13are met:
14
15Redistributions of source code must retain the above copyright notice,
16this list of conditions and the following disclaimer.
17
18Redistributions in binary form must reproduce the above copyright notice,
19this list of conditions and the following disclaimer in the documentation
20and/or other materials provided with the distribution.
21
22Neither the names of ODE's copyright owner nor the names of its
23contributors may be used to endorse or promote products derived from
24this software without specific prior written permission.
25
26THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS
29FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED
32TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR
33PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF
34LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING
35NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
36SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
37 *
38 *
39 */
40
41using System;
42using System.Runtime.InteropServices;
43using OdeAPI;
44
45namespace ODEDrawstuff
46{
47/*#if dDOUBLE
48 using dReal = System.Double;
49#else
50 */
51 using dReal = System.Single;
52//#endif
53
54 public static class ds
55 {
56 public const int VERSION = 2;
57
58 public enum Texture
59 {
60 None,
61 Wood
62 }
63
64 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
65 public delegate void CallbackFunction(int arg);
66
67 [StructLayout(LayoutKind.Sequential)]
68 public struct Functions
69 {
70 public int version;
71 public CallbackFunction start;
72 public CallbackFunction step;
73 public CallbackFunction command;
74 public CallbackFunction stop;
75 public string path_to_textures;
76 }
77
78 [DllImport("drawstuff", EntryPoint = "dsDrawBox")]
79 public static extern void DrawBox(ref d.Vector3 pos, ref d.Matrix3 R, ref d.Vector3 sides);
80
81 [DllImport("drawstuff", EntryPoint = "dsDrawCapsule")]
82 public static extern void DrawCapsule(ref d.Vector3 pos, ref d.Matrix3 R, dReal length, dReal radius);
83
84 [DllImport("drawstuff", EntryPoint = "dsDrawConvex")]
85 public static extern void DrawConvex(ref d.Vector3 pos, ref d.Matrix3 R, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons);
86
87 [DllImport("drawstuff", EntryPoint = "dsSetColor")]
88 public static extern void SetColor(float red, float green, float blue);
89
90 [DllImport("drawstuff", EntryPoint = "dsSetTexture")]
91 public static extern void SetTexture(Texture texture);
92
93 [DllImport("drawstuff", EntryPoint = "dsSetViewpoint")]
94 public static extern void SetViewpoint(ref d.Vector3 xyz, ref d.Vector3 hpr);
95
96 [DllImport("drawstuff", EntryPoint = "dsSimulationLoop")]
97 public static extern void SimulationLoop(int argc, string[] argv, int window_width, int window_height, ref Functions fn);
98 }
99}