diff options
Diffstat (limited to 'libraries/ode-0.9/contrib/Ode.NET/Drawstuff')
3 files changed, 95 insertions, 0 deletions
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 @@ | |||
1 | using System; | ||
2 | using System.Reflection; | ||
3 | using System.Runtime.CompilerServices; | ||
4 | using System.Runtime.InteropServices; | ||
5 | |||
6 | [assembly: AssemblyTitle("Drawstuff.NET")] | ||
7 | [assembly: AssemblyDescription("")] | ||
8 | [assembly: AssemblyConfiguration("")] | ||
9 | [assembly: AssemblyCompany("")] | ||
10 | [assembly: AssemblyProduct("Ode.NET")] | ||
11 | [assembly: AssemblyCopyright("")] | ||
12 | [assembly: AssemblyTrademark("")] | ||
13 | [assembly: AssemblyCulture("")] | ||
14 | [assembly: ComVisible(false)] | ||
15 | [assembly: Guid("b2a39dd4-dd67-4e8a-af70-d3b412da8850")] | ||
16 | [assembly: AssemblyVersion("0.7.0.0")] | ||
17 | [assembly: AssemblyFileVersion("0.7.0.0")] | ||
18 | [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 @@ | |||
1 | using System; | ||
2 | using System.Runtime.InteropServices; | ||
3 | using Ode.NET; | ||
4 | |||
5 | namespace Drawstuff.NET | ||
6 | { | ||
7 | #if dDOUBLE | ||
8 | using dReal = System.Double; | ||
9 | #else | ||
10 | using dReal = System.Single; | ||
11 | #endif | ||
12 | |||
13 | public static class ds | ||
14 | { | ||
15 | public const int VERSION = 2; | ||
16 | |||
17 | public enum Texture | ||
18 | { | ||
19 | None, | ||
20 | Wood | ||
21 | } | ||
22 | |||
23 | [UnmanagedFunctionPointer(CallingConvention.Cdecl)] | ||
24 | public delegate void CallbackFunction(int arg); | ||
25 | |||
26 | [StructLayout(LayoutKind.Sequential)] | ||
27 | public struct Functions | ||
28 | { | ||
29 | public int version; | ||
30 | public CallbackFunction start; | ||
31 | public CallbackFunction step; | ||
32 | public CallbackFunction command; | ||
33 | public CallbackFunction stop; | ||
34 | public string path_to_textures; | ||
35 | } | ||
36 | |||
37 | [DllImport("drawstuff", EntryPoint="dsDrawBox")] | ||
38 | public static extern void DrawBox(ref d.Vector3 pos, ref d.Matrix3 R, ref d.Vector3 sides); | ||
39 | |||
40 | [DllImport("drawstuff", EntryPoint = "dsDrawCapsule")] | ||
41 | public static extern void DrawCapsule(ref d.Vector3 pos, ref d.Matrix3 R, dReal length, dReal radius); | ||
42 | |||
43 | [DllImport("drawstuff", EntryPoint = "dsDrawConvex")] | ||
44 | public static extern void DrawConvex(ref d.Vector3 pos, ref d.Matrix3 R, dReal[] planes, int planeCount, dReal[] points, int pointCount, int[] polygons); | ||
45 | |||
46 | [DllImport("drawstuff", EntryPoint="dsSetColor")] | ||
47 | public static extern void SetColor(float red, float green, float blue); | ||
48 | |||
49 | [DllImport("drawstuff", EntryPoint="dsSetTexture")] | ||
50 | public static extern void SetTexture(Texture texture); | ||
51 | |||
52 | [DllImport("drawstuff", EntryPoint="dsSetViewpoint")] | ||
53 | public static extern void SetViewpoint(ref d.Vector3 xyz, ref d.Vector3 hpr); | ||
54 | |||
55 | [DllImport("drawstuff", EntryPoint="dsSimulationLoop")] | ||
56 | public static extern void SimulationLoop(int argc, string[] argv, int window_width, int window_height, ref Functions fn); | ||
57 | } | ||
58 | } | ||
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 @@ | |||
1 | package.name = "Drawstuff.NET" | ||
2 | package.kind = "dll" | ||
3 | package.language = "c#" | ||
4 | |||
5 | if (options["with-doubles"]) then | ||
6 | package.defines = { "dDOUBLE" } | ||
7 | else | ||
8 | package.defines = { "dSINGLE " } | ||
9 | end | ||
10 | |||
11 | package.links = { | ||
12 | "System", | ||
13 | "Ode.NET" | ||
14 | } | ||
15 | |||
16 | package.files = { | ||
17 | "AssemblyInfo.cs", | ||
18 | "Drawstuff.cs" | ||
19 | } | ||