From 4856dd8d4121f23750baace5fd8bd81869f5ac81 Mon Sep 17 00:00:00 2001 From: Justin Berger Date: Thu, 29 Mar 2018 00:17:07 -0600 Subject: Filled out OO struct; most needed functions are there --- bindings/cs/Demo/Program.cs | 28 +++++++++++++++++++++++++++- 1 file changed, 27 insertions(+), 1 deletion(-) (limited to 'bindings/cs/Demo') diff --git a/bindings/cs/Demo/Program.cs b/bindings/cs/Demo/Program.cs index 1644360..c03d83c 100644 --- a/bindings/cs/Demo/Program.cs +++ b/bindings/cs/Demo/Program.cs @@ -9,13 +9,39 @@ namespace Demo { internal class MyHandler : SurviveContext { - public MyHandler() + private static void WritePose(string name, SurvivePose pose) + { + Console.Out.WriteLine(name); + Console.Out.Write(" [ "); + for (int i = 0; i < 3; i++) + Console.Out.Write("{0} ", pose.Pos[i]); + Console.Out.Write(" ] [ "); + for (int i = 0; i < 4; i++) + Console.Out.Write("{0} ", pose.Rot[i]); + Console.Out.Write(" ] "); + Console.Out.WriteLine(); + } + + public MyHandler() : base() { } public MyHandler(string[] args) : base(args) { } + + protected void LightHouseEvent1(IntPtr ctx, byte lighthouse, SurvivePose lighthouse_pose, SurvivePose object_pose) + { + base.LightHouseEvent(ctx, lighthouse, lighthouse_pose, object_pose); + WritePose("Lighthouse", lighthouse_pose); + WritePose("Object", object_pose); + } + + protected override void PoseEvent(IntPtr so, byte lighthouse, SurvivePose pose) + { + WritePose("Pose", pose); + base.PoseEvent(so, lighthouse, pose); + } } class Program { -- cgit v1.2.3