aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/OpenSim/Region/Physics/UbitOdePlugin/OdeApi.cs
diff options
context:
space:
mode:
authorUbitUmarov2012-02-10 22:43:51 +0000
committerUbitUmarov2012-02-10 22:43:51 +0000
commit7cf73cb92af7d00f9d7a98c1762162d597418a3b (patch)
tree7c3eb5e3492686be05d579b957e51169e3eb6a8b /OpenSim/Region/Physics/UbitOdePlugin/OdeApi.cs
parentinitial introdution of physics actor building control. (diff)
downloadopensim-SC-7cf73cb92af7d00f9d7a98c1762162d597418a3b.zip
opensim-SC-7cf73cb92af7d00f9d7a98c1762162d597418a3b.tar.gz
opensim-SC-7cf73cb92af7d00f9d7a98c1762162d597418a3b.tar.bz2
opensim-SC-7cf73cb92af7d00f9d7a98c1762162d597418a3b.tar.xz
Changes to vehicles code etc. Includes some debug aids to remove later.
Diffstat (limited to '')
-rw-r--r--OpenSim/Region/Physics/UbitOdePlugin/OdeApi.cs85
1 files changed, 71 insertions, 14 deletions
diff --git a/OpenSim/Region/Physics/UbitOdePlugin/OdeApi.cs b/OpenSim/Region/Physics/UbitOdePlugin/OdeApi.cs
index c0c7ff3..2b6bc59 100644
--- a/OpenSim/Region/Physics/UbitOdePlugin/OdeApi.cs
+++ b/OpenSim/Region/Physics/UbitOdePlugin/OdeApi.cs
@@ -59,6 +59,7 @@ namespace OdeAPI
59 { 59 {
60 public static dReal Infinity = dReal.MaxValue; 60 public static dReal Infinity = dReal.MaxValue;
61 public static int NTotalBodies = 0; 61 public static int NTotalBodies = 0;
62 public static int NTotalGeoms = 0;
62 63
63 #region Flags and Enumerations 64 #region Flags and Enumerations
64 65
@@ -420,7 +421,7 @@ namespace OdeAPI
420 421
421 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCreate"), SuppressUnmanagedCodeSecurity] 422 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dBodyCreate"), SuppressUnmanagedCodeSecurity]
422 public static extern IntPtr BodyiCreate(IntPtr world); 423 public static extern IntPtr BodyiCreate(IntPtr world);
423 public static IntPtr BodyCreate(IntPtr world) 424 public static IntPtr BodyCreate(IntPtr world)
424 { 425 {
425 NTotalBodies++; 426 NTotalBodies++;
426 return BodyiCreate(world); 427 return BodyiCreate(world);
@@ -689,22 +690,52 @@ namespace OdeAPI
689 public static extern IntPtr ConnectingJoint(IntPtr j1, IntPtr j2); 690 public static extern IntPtr ConnectingJoint(IntPtr j1, IntPtr j2);
690 691
691 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateBox"), SuppressUnmanagedCodeSecurity] 692 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateBox"), SuppressUnmanagedCodeSecurity]
692 public static extern IntPtr CreateBox(IntPtr space, dReal lx, dReal ly, dReal lz); 693 public static extern IntPtr CreateiBox(IntPtr space, dReal lx, dReal ly, dReal lz);
694 public static IntPtr CreateBox(IntPtr space, dReal lx, dReal ly, dReal lz)
695 {
696 NTotalGeoms++;
697 return CreateiBox(space, lx, ly, lz);
698 }
693 699
694 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateCapsule"), SuppressUnmanagedCodeSecurity] 700 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateCapsule"), SuppressUnmanagedCodeSecurity]
695 public static extern IntPtr CreateCapsule(IntPtr space, dReal radius, dReal length); 701 public static extern IntPtr CreateiCapsule(IntPtr space, dReal radius, dReal length);
702 public static IntPtr CreateCapsule(IntPtr space, dReal radius, dReal length)
703 {
704 NTotalGeoms++;
705 return CreateiCapsule(space, radius, length);
706 }
696 707
697 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateConvex"), SuppressUnmanagedCodeSecurity] 708 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateConvex"), SuppressUnmanagedCodeSecurity]
698 public static extern IntPtr CreateConvex(IntPtr space, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons); 709 public static extern IntPtr CreateiConvex(IntPtr space, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons);
710 public static IntPtr CreateConvex(IntPtr space, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons)
711 {
712 NTotalGeoms++;
713 return CreateiConvex(space, planes, planeCount, points, pointCount, polygons);
714 }
699 715
700 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateCylinder"), SuppressUnmanagedCodeSecurity] 716 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateCylinder"), SuppressUnmanagedCodeSecurity]
701 public static extern IntPtr CreateCylinder(IntPtr space, dReal radius, dReal length); 717 public static extern IntPtr CreateiCylinder(IntPtr space, dReal radius, dReal length);
718 public static IntPtr CreateCylinder(IntPtr space, dReal radius, dReal length)
719 {
720 NTotalGeoms++;
721 return CreateiCylinder(space, radius, length);
722 }
702 723
703 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateHeightfield"), SuppressUnmanagedCodeSecurity] 724 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateHeightfield"), SuppressUnmanagedCodeSecurity]
704 public static extern IntPtr CreateHeightfield(IntPtr space, IntPtr data, int bPlaceable); 725 public static extern IntPtr CreateiHeightfield(IntPtr space, IntPtr data, int bPlaceable);
726 public static IntPtr CreateHeightfield(IntPtr space, IntPtr data, int bPlaceable)
727 {
728 NTotalGeoms++;
729 return CreateiHeightfield(space, data, bPlaceable);
730 }
705 731
706 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeom"), SuppressUnmanagedCodeSecurity] 732 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeom"), SuppressUnmanagedCodeSecurity]
707 public static extern IntPtr CreateGeom(int classnum); 733 public static extern IntPtr CreateiGeom(int classnum);
734 public static IntPtr CreateGeom(int classnum)
735 {
736 NTotalGeoms++;
737 return CreateiGeom(classnum);
738 }
708 739
709 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeomClass"), SuppressUnmanagedCodeSecurity] 740 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateGeomClass"), SuppressUnmanagedCodeSecurity]
710 public static extern int CreateGeomClass(ref GeomClass classptr); 741 public static extern int CreateGeomClass(ref GeomClass classptr);
@@ -713,19 +744,39 @@ namespace OdeAPI
713 public static extern IntPtr CreateGeomTransform(IntPtr space); 744 public static extern IntPtr CreateGeomTransform(IntPtr space);
714 745
715 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreatePlane"), SuppressUnmanagedCodeSecurity] 746 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreatePlane"), SuppressUnmanagedCodeSecurity]
716 public static extern IntPtr CreatePlane(IntPtr space, dReal a, dReal b, dReal c, dReal d); 747 public static extern IntPtr CreateiPlane(IntPtr space, dReal a, dReal b, dReal c, dReal d);
748 public static IntPtr CreatePlane(IntPtr space, dReal a, dReal b, dReal c, dReal d)
749 {
750 NTotalGeoms++;
751 return CreateiPlane(space, a, b, c, d);
752 }
717 753
718 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateRay"), SuppressUnmanagedCodeSecurity] 754 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateRay"), SuppressUnmanagedCodeSecurity]
719 public static extern IntPtr CreateRay(IntPtr space, dReal length); 755 public static extern IntPtr CreateiRay(IntPtr space, dReal length);
756 public static IntPtr CreateRay(IntPtr space, dReal length)
757 {
758 NTotalGeoms++;
759 return CreateiRay(space, length);
760 }
720 761
721 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateSphere"), SuppressUnmanagedCodeSecurity] 762 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateSphere"), SuppressUnmanagedCodeSecurity]
722 public static extern IntPtr CreateSphere(IntPtr space, dReal radius); 763 public static extern IntPtr CreateiSphere(IntPtr space, dReal radius);
764 public static IntPtr CreateSphere(IntPtr space, dReal radius)
765 {
766 NTotalGeoms++;
767 return CreateiSphere(space, radius);
768 }
723 769
724 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateTriMesh"), SuppressUnmanagedCodeSecurity] 770 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dCreateTriMesh"), SuppressUnmanagedCodeSecurity]
725 public static extern IntPtr CreateTriMesh(IntPtr space, IntPtr data, 771 public static extern IntPtr CreateiTriMesh(IntPtr space, IntPtr data,
726 TriCallback callback, TriArrayCallback arrayCallback, TriRayCallback rayCallback); 772 TriCallback callback, TriArrayCallback arrayCallback, TriRayCallback rayCallback);
727 773 public static IntPtr CreateTriMesh(IntPtr space, IntPtr data,
728 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dDot"), SuppressUnmanagedCodeSecurity] 774 TriCallback callback, TriArrayCallback arrayCallback, TriRayCallback rayCallback)
775 {
776 NTotalGeoms++;
777 return CreateiTriMesh(space, data, callback, arrayCallback, rayCallback);
778 }
779 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dDot"), SuppressUnmanagedCodeSecurity]
729 public static extern dReal Dot(ref dReal X0, ref dReal X1, int n); 780 public static extern dReal Dot(ref dReal X0, ref dReal X1, int n);
730 781
731 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dDQfromW"), SuppressUnmanagedCodeSecurity] 782 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dDQfromW"), SuppressUnmanagedCodeSecurity]
@@ -798,7 +849,13 @@ namespace OdeAPI
798 public static extern void GeomCylinderSetParams(IntPtr geom, dReal radius, dReal length); 849 public static extern void GeomCylinderSetParams(IntPtr geom, dReal radius, dReal length);
799 850
800 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomDestroy"), SuppressUnmanagedCodeSecurity] 851 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomDestroy"), SuppressUnmanagedCodeSecurity]
801 public static extern void GeomDestroy(IntPtr geom); 852 public static extern void GeomiDestroy(IntPtr geom);
853 public static void GeomDestroy(IntPtr geom)
854 {
855 NTotalGeoms--;
856 GeomiDestroy(geom);
857 }
858
802 859
803 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomDisable"), SuppressUnmanagedCodeSecurity] 860 [DllImport("ode", CallingConvention = CallingConvention.Cdecl, EntryPoint = "dGeomDisable"), SuppressUnmanagedCodeSecurity]
804 public static extern void GeomDisable(IntPtr geom); 861 public static extern void GeomDisable(IntPtr geom);