From d48ea5bb797037069d641da41da0f195f0124491 Mon Sep 17 00:00:00 2001 From: dan miller Date: Fri, 19 Oct 2007 05:20:48 +0000 Subject: one more for the gipper --- .../contrib/Ode.NET/Drawstuff/AssemblyInfo.cs | 18 +++++++ .../ode-0.9/contrib/Ode.NET/Drawstuff/Drawstuff.cs | 58 ++++++++++++++++++++++ .../ode-0.9/contrib/Ode.NET/Drawstuff/premake.lua | 19 +++++++ 3 files changed, 95 insertions(+) create mode 100644 libraries/ode-0.9/contrib/Ode.NET/Drawstuff/AssemblyInfo.cs create mode 100644 libraries/ode-0.9/contrib/Ode.NET/Drawstuff/Drawstuff.cs create mode 100644 libraries/ode-0.9/contrib/Ode.NET/Drawstuff/premake.lua (limited to 'libraries/ode-0.9/contrib/Ode.NET/Drawstuff') diff --git a/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/AssemblyInfo.cs b/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/AssemblyInfo.cs new file mode 100644 index 0000000..8d2b86a --- /dev/null +++ b/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/AssemblyInfo.cs @@ -0,0 +1,18 @@ +using System; +using System.Reflection; +using System.Runtime.CompilerServices; +using System.Runtime.InteropServices; + +[assembly: AssemblyTitle("Drawstuff.NET")] +[assembly: AssemblyDescription("")] +[assembly: AssemblyConfiguration("")] +[assembly: AssemblyCompany("")] +[assembly: AssemblyProduct("Ode.NET")] +[assembly: AssemblyCopyright("")] +[assembly: AssemblyTrademark("")] +[assembly: AssemblyCulture("")] +[assembly: ComVisible(false)] +[assembly: Guid("b2a39dd4-dd67-4e8a-af70-d3b412da8850")] +[assembly: AssemblyVersion("0.7.0.0")] +[assembly: AssemblyFileVersion("0.7.0.0")] +[assembly: CLSCompliantAttribute(true)] diff --git a/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/Drawstuff.cs b/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/Drawstuff.cs new file mode 100644 index 0000000..aa84966 --- /dev/null +++ b/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/Drawstuff.cs @@ -0,0 +1,58 @@ +using System; +using System.Runtime.InteropServices; +using Ode.NET; + +namespace Drawstuff.NET +{ +#if dDOUBLE + using dReal = System.Double; +#else + using dReal = System.Single; +#endif + + public static class ds + { + public const int VERSION = 2; + + public enum Texture + { + None, + Wood + } + + [UnmanagedFunctionPointer(CallingConvention.Cdecl)] + public delegate void CallbackFunction(int arg); + + [StructLayout(LayoutKind.Sequential)] + public struct Functions + { + public int version; + public CallbackFunction start; + public CallbackFunction step; + public CallbackFunction command; + public CallbackFunction stop; + public string path_to_textures; + } + + [DllImport("drawstuff", EntryPoint="dsDrawBox")] + public static extern void DrawBox(ref d.Vector3 pos, ref d.Matrix3 R, ref d.Vector3 sides); + + [DllImport("drawstuff", EntryPoint = "dsDrawCapsule")] + public static extern void DrawCapsule(ref d.Vector3 pos, ref d.Matrix3 R, dReal length, dReal radius); + + [DllImport("drawstuff", EntryPoint = "dsDrawConvex")] + public static extern void DrawConvex(ref d.Vector3 pos, ref d.Matrix3 R, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons); + + [DllImport("drawstuff", EntryPoint="dsSetColor")] + public static extern void SetColor(float red, float green, float blue); + + [DllImport("drawstuff", EntryPoint="dsSetTexture")] + public static extern void SetTexture(Texture texture); + + [DllImport("drawstuff", EntryPoint="dsSetViewpoint")] + public static extern void SetViewpoint(ref d.Vector3 xyz, ref d.Vector3 hpr); + + [DllImport("drawstuff", EntryPoint="dsSimulationLoop")] + public static extern void SimulationLoop(int argc, string[] argv, int window_width, int window_height, ref Functions fn); + } +} diff --git a/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/premake.lua b/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/premake.lua new file mode 100644 index 0000000..d777ffb --- /dev/null +++ b/libraries/ode-0.9/contrib/Ode.NET/Drawstuff/premake.lua @@ -0,0 +1,19 @@ +package.name = "Drawstuff.NET" +package.kind = "dll" +package.language = "c#" + +if (options["with-doubles"]) then + package.defines = { "dDOUBLE" } +else + package.defines = { "dSINGLE " } +end + +package.links = { + "System", + "Ode.NET" +} + +package.files = { + "AssemblyInfo.cs", + "Drawstuff.cs" +} -- cgit v1.1