aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/PhysicsModules/Ode
diff options
context:
space:
mode:
authorUbitUmarov2015-11-20 18:25:56 +0000
committerUbitUmarov2015-11-20 18:25:56 +0000
commit25983c1ba9428c5cd8aabb1f81381c60378db9ab (patch)
treee9d866ad0fa9009c4737c2434c73070d7301e5cb /OpenSim/Region/PhysicsModules/Ode
parentchange ScriptStopStrategy to the default value co-op (mantis 7740 (diff)
downloadopensim-SC-25983c1ba9428c5cd8aabb1f81381c60378db9ab.zip
opensim-SC-25983c1ba9428c5cd8aabb1f81381c60378db9ab.tar.gz
opensim-SC-25983c1ba9428c5cd8aabb1f81381c60378db9ab.tar.bz2
opensim-SC-25983c1ba9428c5cd8aabb1f81381c60378db9ab.tar.xz
remove the hard to maintain Ode.Net wrapper only in use by old ode
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs5
-rw-r--r--OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs2
-rw-r--r--OpenSim/Region/PhysicsModules/Ode/ODEModule.cs1
-rw-r--r--OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs48
-rw-r--r--OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs3
-rw-r--r--OpenSim/Region/PhysicsModules/Ode/OdePhysicsJoint.cs2
-rw-r--r--OpenSim/Region/PhysicsModules/Ode/OdeScene.cs164
-rw-r--r--OpenSim/Region/PhysicsModules/Ode/drawstuff.cs98
8 files changed, 33 insertions, 290 deletions
diff --git a/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs b/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs
index c1afe13..4c9df9c 100644
--- a/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs
+++ b/OpenSim/Region/PhysicsModules/Ode/ODECharacter.cs
@@ -29,7 +29,6 @@ using System;
29using System.Collections.Generic; 29using System.Collections.Generic;
30using System.Reflection; 30using System.Reflection;
31using OpenMetaverse; 31using OpenMetaverse;
32using Ode.NET;
33using OpenSim.Framework; 32using OpenSim.Framework;
34using OpenSim.Region.PhysicsModules.SharedBase; 33using OpenSim.Region.PhysicsModules.SharedBase;
35using log4net; 34using log4net;
@@ -1105,8 +1104,8 @@ namespace OpenSim.Region.PhysicsModule.ODE
1105// lock (OdeScene.UniversalColliderSyncObject) 1104// lock (OdeScene.UniversalColliderSyncObject)
1106 Shell = d.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH); 1105 Shell = d.CreateCapsule(_parent_scene.space, CAPSULE_RADIUS, CAPSULE_LENGTH);
1107 1106
1108 d.GeomSetCategoryBits(Shell, (int)m_collisionCategories); 1107 d.GeomSetCategoryBits(Shell, (uint)m_collisionCategories);
1109 d.GeomSetCollideBits(Shell, (int)m_collisionFlags); 1108 d.GeomSetCollideBits(Shell, (uint)m_collisionFlags);
1110 1109
1111 d.MassSetCapsuleTotal(out ShellMass, m_mass, 2, CAPSULE_RADIUS, CAPSULE_LENGTH); 1110 d.MassSetCapsuleTotal(out ShellMass, m_mass, 2, CAPSULE_RADIUS, CAPSULE_LENGTH);
1112 Body = d.BodyCreate(_parent_scene.world); 1111 Body = d.BodyCreate(_parent_scene.world);
diff --git a/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs b/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs
index 8f8e2bd..739a7b3 100644
--- a/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs
+++ b/OpenSim/Region/PhysicsModules/Ode/ODEDynamics.cs
@@ -44,10 +44,10 @@ using System.Reflection;
44using System.Runtime.InteropServices; 44using System.Runtime.InteropServices;
45using log4net; 45using log4net;
46using OpenMetaverse; 46using OpenMetaverse;
47using Ode.NET;
48using OpenSim.Framework; 47using OpenSim.Framework;
49using OpenSim.Region.PhysicsModules.SharedBase; 48using OpenSim.Region.PhysicsModules.SharedBase;
50 49
50
51namespace OpenSim.Region.PhysicsModule.ODE 51namespace OpenSim.Region.PhysicsModule.ODE
52{ 52{
53 public class ODEDynamics 53 public class ODEDynamics
diff --git a/OpenSim/Region/PhysicsModules/Ode/ODEModule.cs b/OpenSim/Region/PhysicsModules/Ode/ODEModule.cs
index 101e8b0..ed50de3 100644
--- a/OpenSim/Region/PhysicsModules/Ode/ODEModule.cs
+++ b/OpenSim/Region/PhysicsModules/Ode/ODEModule.cs
@@ -6,7 +6,6 @@ using Mono.Addins;
6using OpenSim.Framework; 6using OpenSim.Framework;
7using OpenSim.Region.Framework.Scenes; 7using OpenSim.Region.Framework.Scenes;
8using OpenSim.Region.Framework.Interfaces; 8using OpenSim.Region.Framework.Interfaces;
9using Ode.NET;
10 9
11namespace OpenSim.Region.PhysicsModule.ODE 10namespace OpenSim.Region.PhysicsModule.ODE
12{ 11{
diff --git a/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs b/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs
index 908b266..82b0999 100644
--- a/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs
+++ b/OpenSim/Region/PhysicsModules/Ode/ODEPrim.cs
@@ -48,7 +48,6 @@ using System.Runtime.InteropServices;
48using System.Threading; 48using System.Threading;
49using log4net; 49using log4net;
50using OpenMetaverse; 50using OpenMetaverse;
51using Ode.NET;
52using OpenSim.Framework; 51using OpenSim.Framework;
53using OpenSim.Region.PhysicsModules.SharedBase; 52using OpenSim.Region.PhysicsModules.SharedBase;
54 53
@@ -359,12 +358,12 @@ namespace OpenSim.Region.PhysicsModule.ODE
359 if (m_assetFailed) 358 if (m_assetFailed)
360 { 359 {
361 d.GeomSetCategoryBits(prim_geom, 0); 360 d.GeomSetCategoryBits(prim_geom, 0);
362 d.GeomSetCollideBits(prim_geom, BadMeshAssetCollideBits); 361 d.GeomSetCollideBits(prim_geom, (uint)BadMeshAssetCollideBits);
363 } 362 }
364 else 363 else
365 { 364 {
366 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); 365 d.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories);
367 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 366 d.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags);
368 } 367 }
369 368
370 _parent_scene.geom_name_map[prim_geom] = Name; 369 _parent_scene.geom_name_map[prim_geom] = Name;
@@ -432,7 +431,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
432 if (m_assetFailed) 431 if (m_assetFailed)
433 { 432 {
434 d.GeomSetCategoryBits(prim_geom, 0); 433 d.GeomSetCategoryBits(prim_geom, 0);
435 d.GeomSetCollideBits(prim_geom, BadMeshAssetCollideBits); 434 d.GeomSetCollideBits(prim_geom, (uint)BadMeshAssetCollideBits);
436 } 435 }
437 else 436 else
438 { 437 {
@@ -440,8 +439,8 @@ namespace OpenSim.Region.PhysicsModule.ODE
440 m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind); 439 m_collisionFlags |= (CollisionCategories.Land | CollisionCategories.Wind);
441 } 440 }
442 441
443 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); 442 d.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories);
444 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 443 d.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags);
445 444
446 d.BodySetAutoDisableFlag(Body, true); 445 d.BodySetAutoDisableFlag(Body, true);
447 d.BodySetAutoDisableSteps(Body, body_autodisable_frames); 446 d.BodySetAutoDisableSteps(Body, body_autodisable_frames);
@@ -825,8 +824,8 @@ namespace OpenSim.Region.PhysicsModule.ODE
825 } 824 }
826 else 825 else
827 { 826 {
828 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); 827 d.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories);
829 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 828 d.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags);
830 } 829 }
831 830
832 d.BodyDestroy(Body); 831 d.BodyDestroy(Body);
@@ -859,8 +858,8 @@ namespace OpenSim.Region.PhysicsModule.ODE
859 else 858 else
860 { 859 {
861 860
862 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); 861 d.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories);
863 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 862 d.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags);
864 } 863 }
865 864
866 Body = IntPtr.Zero; 865 Body = IntPtr.Zero;
@@ -1151,12 +1150,12 @@ Console.WriteLine("ZProcessTaints for " + Name);
1151 if (prm.m_assetFailed) 1150 if (prm.m_assetFailed)
1152 { 1151 {
1153 d.GeomSetCategoryBits(prm.prim_geom, 0); 1152 d.GeomSetCategoryBits(prm.prim_geom, 0);
1154 d.GeomSetCollideBits(prm.prim_geom, prm.BadMeshAssetCollideBits); 1153 d.GeomSetCollideBits(prm.prim_geom, (uint)prm.BadMeshAssetCollideBits);
1155 } 1154 }
1156 else 1155 else
1157 { 1156 {
1158 d.GeomSetCategoryBits(prm.prim_geom, (int)prm.m_collisionCategories); 1157 d.GeomSetCategoryBits(prm.prim_geom, (uint)prm.m_collisionCategories);
1159 d.GeomSetCollideBits(prm.prim_geom, (int)prm.m_collisionFlags); 1158 d.GeomSetCollideBits(prm.prim_geom, (uint)prm.m_collisionFlags);
1160 } 1159 }
1161 1160
1162 d.Quaternion quat = new d.Quaternion(); 1161 d.Quaternion quat = new d.Quaternion();
@@ -1200,14 +1199,14 @@ Console.WriteLine("ZProcessTaints for " + Name);
1200 if (m_assetFailed) 1199 if (m_assetFailed)
1201 { 1200 {
1202 d.GeomSetCategoryBits(prim_geom, 0); 1201 d.GeomSetCategoryBits(prim_geom, 0);
1203 d.GeomSetCollideBits(prim_geom, BadMeshAssetCollideBits); 1202 d.GeomSetCollideBits(prim_geom, (uint)BadMeshAssetCollideBits);
1204 } 1203 }
1205 else 1204 else
1206 { 1205 {
1207 //Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + Name); 1206 //Console.WriteLine("GeomSetCategoryBits 2: " + prim_geom + " - " + (int)m_collisionCategories + " for " + Name);
1208 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); 1207 d.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories);
1209 //Console.WriteLine(" Post GeomSetCategoryBits 2"); 1208 //Console.WriteLine(" Post GeomSetCategoryBits 2");
1210 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 1209 d.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags);
1211 } 1210 }
1212 1211
1213 d.Quaternion quat2 = new d.Quaternion(); 1212 d.Quaternion quat2 = new d.Quaternion();
@@ -1377,8 +1376,8 @@ Console.WriteLine("ZProcessTaints for " + Name);
1377 } 1376 }
1378 else 1377 else
1379 { 1378 {
1380 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); 1379 d.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories);
1381 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 1380 d.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags);
1382 } 1381 }
1383 1382
1384 if (IsPhysical) 1383 if (IsPhysical)
@@ -1403,12 +1402,12 @@ Console.WriteLine("ZProcessTaints for " + Name);
1403 if (m_assetFailed) 1402 if (m_assetFailed)
1404 { 1403 {
1405 d.GeomSetCategoryBits(prim_geom, 0); 1404 d.GeomSetCategoryBits(prim_geom, 0);
1406 d.GeomSetCollideBits(prim_geom, BadMeshAssetCollideBits); 1405 d.GeomSetCollideBits(prim_geom, (uint)BadMeshAssetCollideBits);
1407 } 1406 }
1408 else 1407 else
1409 { 1408 {
1410 d.GeomSetCategoryBits(prim_geom, (int)m_collisionCategories); 1409 d.GeomSetCategoryBits(prim_geom, (uint)m_collisionCategories);
1411 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 1410 d.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags);
1412 } 1411 }
1413 1412
1414 if (IsPhysical) 1413 if (IsPhysical)
@@ -2135,10 +2134,10 @@ Console.WriteLine(" JointCreateFixed");
2135 } 2134 }
2136 2135
2137 if (m_assetFailed) 2136 if (m_assetFailed)
2138 d.GeomSetCollideBits(prim_geom, BadMeshAssetCollideBits); 2137 d.GeomSetCollideBits(prim_geom, (uint)BadMeshAssetCollideBits);
2139 else 2138 else
2140 2139
2141 d.GeomSetCollideBits(prim_geom, (int)m_collisionFlags); 2140 d.GeomSetCollideBits(prim_geom, (uint)m_collisionFlags);
2142 } 2141 }
2143 /// <summary> 2142 /// <summary>
2144 /// Change prim in response to a shape taint. 2143 /// Change prim in response to a shape taint.
@@ -2813,6 +2812,7 @@ Console.WriteLine(" JointCreateFixed");
2813 d.BodySetLinearVel(Body, 0, 0, 0); 2812 d.BodySetLinearVel(Body, 0, 0, 0);
2814 disableBodySoft(); 2813 disableBodySoft();
2815 2814
2815 _position = l_position;
2816 // tell framework to fix it 2816 // tell framework to fix it
2817 if (_parent == null) 2817 if (_parent == null)
2818 base.RequestPhysicsterseUpdate(); 2818 base.RequestPhysicsterseUpdate();
diff --git a/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs b/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs
index 6199387..e39b8c7 100644
--- a/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs
+++ b/OpenSim/Region/PhysicsModules/Ode/ODERayCastRequestManager.cs
@@ -32,7 +32,6 @@ using System.Runtime.InteropServices;
32using System.Text; 32using System.Text;
33using OpenMetaverse; 33using OpenMetaverse;
34using OpenSim.Region.PhysicsModules.SharedBase; 34using OpenSim.Region.PhysicsModules.SharedBase;
35using Ode.NET;
36using log4net; 35using log4net;
37 36
38namespace OpenSim.Region.PhysicsModule.ODE 37namespace OpenSim.Region.PhysicsModule.ODE
@@ -358,7 +357,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
358 357
359 lock (contacts) 358 lock (contacts)
360 { 359 {
361 count = d.Collide(g1, g2, contacts.GetLength(0), contacts, d.ContactGeom.SizeOf); 360 count = d.Collide(g1, g2, contacts.GetLength(0), contacts, d.ContactGeom.unmanagedSizeOf);
362 } 361 }
363 } 362 }
364 catch (SEHException) 363 catch (SEHException)
diff --git a/OpenSim/Region/PhysicsModules/Ode/OdePhysicsJoint.cs b/OpenSim/Region/PhysicsModules/Ode/OdePhysicsJoint.cs
index 2eb7ba6..e2578be 100644
--- a/OpenSim/Region/PhysicsModules/Ode/OdePhysicsJoint.cs
+++ b/OpenSim/Region/PhysicsModules/Ode/OdePhysicsJoint.cs
@@ -27,10 +27,8 @@
27 27
28using System; 28using System;
29using OpenMetaverse; 29using OpenMetaverse;
30using Ode.NET;
31using OpenSim.Framework; 30using OpenSim.Framework;
32using OpenSim.Region.PhysicsModules.SharedBase; 31using OpenSim.Region.PhysicsModules.SharedBase;
33using OpenSim.Region.PhysicsModule.ODE;
34 32
35namespace OpenSim.Region.PhysicsModule.ODE 33namespace OpenSim.Region.PhysicsModule.ODE
36{ 34{
diff --git a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs
index 4e95b7a..6f14121 100644
--- a/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs
+++ b/OpenSim/Region/PhysicsModules/Ode/OdeScene.cs
@@ -31,9 +31,6 @@
31// or application thread stack may just blowup 31// or application thread stack may just blowup
32// see RayCast(ODERayCastRequest req) 32// see RayCast(ODERayCastRequest req)
33 33
34//#define USE_DRAWSTUFF
35//#define SPAM
36
37using System; 34using System;
38using System.Collections.Generic; 35using System.Collections.Generic;
39using System.Diagnostics; 36using System.Diagnostics;
@@ -46,17 +43,12 @@ using System.Threading;
46using log4net; 43using log4net;
47using Nini.Config; 44using Nini.Config;
48using Mono.Addins; 45using Mono.Addins;
49using Ode.NET;
50using OpenMetaverse; 46using OpenMetaverse;
51#if USE_DRAWSTUFF
52using Drawstuff.NET;
53#endif
54using OpenSim.Framework; 47using OpenSim.Framework;
55using OpenSim.Region.PhysicsModules.SharedBase; 48using OpenSim.Region.PhysicsModules.SharedBase;
56using OpenSim.Region.Framework.Scenes; 49using OpenSim.Region.Framework.Scenes;
57using OpenSim.Region.Framework.Interfaces; 50using OpenSim.Region.Framework.Interfaces;
58 51
59
60namespace OpenSim.Region.PhysicsModule.ODE 52namespace OpenSim.Region.PhysicsModule.ODE
61{ 53{
62 public enum StatusIndicators : int 54 public enum StatusIndicators : int
@@ -585,32 +577,12 @@ namespace OpenSim.Region.PhysicsModule.ODE
585 577
586 d.WorldSetAutoDisableFlag(world, false); 578 d.WorldSetAutoDisableFlag(world, false);
587 579
588 #if USE_DRAWSTUFF 580// _watermap = new float[258 * 258];
589 Thread viewthread = new Thread(new ParameterizedThreadStart(startvisualization));
590 viewthread.Start();
591 #endif
592
593 // _watermap = new float[258 * 258];
594 581
595 // Zero out the prim spaces array (we split our space into smaller spaces so 582 // Zero out the prim spaces array (we split our space into smaller spaces so
596 // we can hit test less. 583 // we can hit test less.
597 } 584 }
598 585
599#if USE_DRAWSTUFF
600 public void startvisualization(object o)
601 {
602 ds.Functions fn;
603 fn.version = ds.VERSION;
604 fn.start = new ds.CallbackFunction(start);
605 fn.step = new ds.CallbackFunction(step);
606 fn.command = new ds.CallbackFunction(command);
607 fn.stop = null;
608 fn.path_to_textures = "./textures";
609 string[] args = new string[0];
610 ds.SimulationLoop(args.Length, args, 352, 288, ref fn);
611 }
612#endif
613
614 // Initialize from configs 586 // Initialize from configs
615 private void InitialiseFromConfig(IConfigSource config) 587 private void InitialiseFromConfig(IConfigSource config)
616 { 588 {
@@ -957,7 +929,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
957 /// <param name='contactsArray'></param> 929 /// <param name='contactsArray'></param>
958 /// <param name='contactGeomSize'></param> 930 /// <param name='contactGeomSize'></param>
959 private int CollideGeoms( 931 private int CollideGeoms(
960 IntPtr geom1, IntPtr geom2, int maxContacts, Ode.NET.d.ContactGeom[] contactsArray, int contactGeomSize) 932 IntPtr geom1, IntPtr geom2, int maxContacts, d.ContactGeom[] contactsArray, int contactGeomSize)
961 { 933 {
962 int count; 934 int count;
963 935
@@ -1090,7 +1062,7 @@ namespace OpenSim.Region.PhysicsModule.ODE
1090 if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnectedExcluding(b1, b2, d.JointType.Contact)) 1062 if (b1 != IntPtr.Zero && b2 != IntPtr.Zero && d.AreConnectedExcluding(b1, b2, d.JointType.Contact))
1091 return; 1063 return;
1092 1064
1093 count = CollideGeoms(g1, g2, contacts.Length, contacts, d.ContactGeom.SizeOf); 1065 count = CollideGeoms(g1, g2, contacts.Length, contacts, d.ContactGeom.unmanagedSizeOf);
1094 1066
1095 // All code after this is only relevant if we have any collisions 1067 // All code after this is only relevant if we have any collisions
1096 if (count <= 0) 1068 if (count <= 0)
@@ -2972,7 +2944,8 @@ namespace OpenSim.Region.PhysicsModule.ODE
2972 /// <returns>The number of frames simulated over that period.</returns> 2944 /// <returns>The number of frames simulated over that period.</returns>
2973 public override float Simulate(float timeStep) 2945 public override float Simulate(float timeStep)
2974 { 2946 {
2975 if (!_worldInitialized) return 11f; 2947 if (!_worldInitialized)
2948 return 1.0f;
2976 2949
2977 int startFrameTick = CollectStats ? Util.EnvironmentTickCount() : 0; 2950 int startFrameTick = CollectStats ? Util.EnvironmentTickCount() : 0;
2978 int tempTick = 0, tempTick2 = 0; 2951 int tempTick = 0, tempTick2 = 0;
@@ -3804,133 +3777,6 @@ namespace OpenSim.Region.PhysicsModule.ODE
3804 return new List<ContactResult>(ourResults); 3777 return new List<ContactResult>(ourResults);
3805 } 3778 }
3806 3779
3807#if USE_DRAWSTUFF
3808 // Keyboard callback
3809 public void command(int cmd)
3810 {
3811 IntPtr geom;
3812 d.Mass mass;
3813 d.Vector3 sides = new d.Vector3(d.RandReal() * 0.5f + 0.1f, d.RandReal() * 0.5f + 0.1f, d.RandReal() * 0.5f + 0.1f);
3814
3815
3816
3817 Char ch = Char.ToLower((Char)cmd);
3818 switch ((Char)ch)
3819 {
3820 case 'w':
3821 try
3822 {
3823 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));
3824
3825 xyz.X += rotate.X; xyz.Y += rotate.Y; xyz.Z += rotate.Z;
3826 ds.SetViewpoint(ref xyz, ref hpr);
3827 }
3828 catch (ArgumentException)
3829 { hpr.X = 0; }
3830 break;
3831
3832 case 'a':
3833 hpr.X++;
3834 ds.SetViewpoint(ref xyz, ref hpr);
3835 break;
3836
3837 case 's':
3838 try
3839 {
3840 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));
3841
3842 xyz.X += rotate2.X; xyz.Y += rotate2.Y; xyz.Z += rotate2.Z;
3843 ds.SetViewpoint(ref xyz, ref hpr);
3844 }
3845 catch (ArgumentException)
3846 { hpr.X = 0; }
3847 break;
3848 case 'd':
3849 hpr.X--;
3850 ds.SetViewpoint(ref xyz, ref hpr);
3851 break;
3852 case 'r':
3853 xyz.Z++;
3854 ds.SetViewpoint(ref xyz, ref hpr);
3855 break;
3856 case 'f':
3857 xyz.Z--;
3858 ds.SetViewpoint(ref xyz, ref hpr);
3859 break;
3860 case 'e':
3861 xyz.Y++;
3862 ds.SetViewpoint(ref xyz, ref hpr);
3863 break;
3864 case 'q':
3865 xyz.Y--;
3866 ds.SetViewpoint(ref xyz, ref hpr);
3867 break;
3868 }
3869 }
3870
3871 public void step(int pause)
3872 {
3873
3874 ds.SetColor(1.0f, 1.0f, 0.0f);
3875 ds.SetTexture(ds.Texture.Wood);
3876 lock (_prims)
3877 {
3878 foreach (OdePrim prm in _prims)
3879 {
3880 //IntPtr body = d.GeomGetBody(prm.prim_geom);
3881 if (prm.prim_geom != IntPtr.Zero)
3882 {
3883 d.Vector3 pos;
3884 d.GeomCopyPosition(prm.prim_geom, out pos);
3885 //d.BodyCopyPosition(body, out pos);
3886
3887 d.Matrix3 R;
3888 d.GeomCopyRotation(prm.prim_geom, out R);
3889 //d.BodyCopyRotation(body, out R);
3890
3891
3892 d.Vector3 sides = new d.Vector3();
3893 sides.X = prm.Size.X;
3894 sides.Y = prm.Size.Y;
3895 sides.Z = prm.Size.Z;
3896
3897 ds.DrawBox(ref pos, ref R, ref sides);
3898 }
3899 }
3900 }
3901 ds.SetColor(1.0f, 0.0f, 0.0f);
3902
3903 foreach (OdeCharacter chr in _characters)
3904 {
3905 if (chr.Shell != IntPtr.Zero)
3906 {
3907 IntPtr body = d.GeomGetBody(chr.Shell);
3908
3909 d.Vector3 pos;
3910 d.GeomCopyPosition(chr.Shell, out pos);
3911 //d.BodyCopyPosition(body, out pos);
3912
3913 d.Matrix3 R;
3914 d.GeomCopyRotation(chr.Shell, out R);
3915 //d.BodyCopyRotation(body, out R);
3916
3917 ds.DrawCapsule(ref pos, ref R, chr.Size.Z, 0.35f);
3918 d.Vector3 sides = new d.Vector3();
3919 sides.X = 0.5f;
3920 sides.Y = 0.5f;
3921 sides.Z = 0.5f;
3922
3923 ds.DrawBox(ref pos, ref R, ref sides);
3924 }
3925 }
3926 }
3927
3928 public void start(int unused)
3929 {
3930 ds.SetViewpoint(ref xyz, ref hpr);
3931 }
3932#endif
3933
3934 public override Dictionary<string, float> GetStats() 3780 public override Dictionary<string, float> GetStats()
3935 { 3781 {
3936 if (!CollectStats) 3782 if (!CollectStats)
diff --git a/OpenSim/Region/PhysicsModules/Ode/drawstuff.cs b/OpenSim/Region/PhysicsModules/Ode/drawstuff.cs
deleted file mode 100644
index 87ca446..0000000
--- a/OpenSim/Region/PhysicsModules/Ode/drawstuff.cs
+++ /dev/null
@@ -1,98 +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 Ode.NET;
44
45namespace Drawstuff.NET
46{
47#if dDOUBLE
48 using dReal = System.Double;
49#else
50 using dReal = System.Single;
51#endif
52
53 public static class ds
54 {
55 public const int VERSION = 2;
56
57 public enum Texture
58 {
59 None,
60 Wood
61 }
62
63 [UnmanagedFunctionPointer(CallingConvention.Cdecl)]
64 public delegate void CallbackFunction(int arg);
65
66 [StructLayout(LayoutKind.Sequential)]
67 public struct Functions
68 {
69 public int version;
70 public CallbackFunction start;
71 public CallbackFunction step;
72 public CallbackFunction command;
73 public CallbackFunction stop;
74 public string path_to_textures;
75 }
76
77 [DllImport("drawstuff", EntryPoint = "dsDrawBox")]
78 public static extern void DrawBox(ref d.Vector3 pos, ref d.Matrix3 R, ref d.Vector3 sides);
79
80 [DllImport("drawstuff", EntryPoint = "dsDrawCapsule")]
81 public static extern void DrawCapsule(ref d.Vector3 pos, ref d.Matrix3 R, dReal length, dReal radius);
82
83 [DllImport("drawstuff", EntryPoint = "dsDrawConvex")]
84 public static extern void DrawConvex(ref d.Vector3 pos, ref d.Matrix3 R, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons);
85
86 [DllImport("drawstuff", EntryPoint = "dsSetColor")]
87 public static extern void SetColor(float red, float green, float blue);
88
89 [DllImport("drawstuff", EntryPoint = "dsSetTexture")]
90 public static extern void SetTexture(Texture texture);
91
92 [DllImport("drawstuff", EntryPoint = "dsSetViewpoint")]
93 public static extern void SetViewpoint(ref d.Vector3 xyz, ref d.Vector3 hpr);
94
95 [DllImport("drawstuff", EntryPoint = "dsSimulationLoop")]
96 public static extern void SimulationLoop(int argc, string[] argv, int window_width, int window_height, ref Functions fn);
97 }
98}