aboutsummaryrefslogtreecommitdiff
path: root/bindings/cs/Demo/Program.cs
diff options
context:
space:
mode:
authorJustin Berger <j.david.berger@gmail.com>2018-04-03 23:44:14 -0600
committerJustin Berger <j.david.berger@gmail.com>2018-04-03 23:44:14 -0600
commitc7d9d271796b20f886e2441de852498ecb25ca82 (patch)
tree5929c2793c33c80e5392982a9baaa8d5ccaca724 /bindings/cs/Demo/Program.cs
parentfe025b0ff6bfb440da7cec8f388fa951910a86f0 (diff)
parent6a45298c9bc34aac59cc2ebb9de2d82c7a42756e (diff)
downloadlibsurvive-c7d9d271796b20f886e2441de852498ecb25ca82.tar.gz
libsurvive-c7d9d271796b20f886e2441de852498ecb25ca82.tar.bz2
Merge branch 'master' into imu
Diffstat (limited to 'bindings/cs/Demo/Program.cs')
-rw-r--r--bindings/cs/Demo/Program.cs45
1 files changed, 7 insertions, 38 deletions
diff --git a/bindings/cs/Demo/Program.cs b/bindings/cs/Demo/Program.cs
index c03d83c..c838a4e 100644
--- a/bindings/cs/Demo/Program.cs
+++ b/bindings/cs/Demo/Program.cs
@@ -7,50 +7,19 @@ using System.Threading.Tasks;
namespace Demo
{
- internal class MyHandler : SurviveContext
+
+ class Program
{
- private static void WritePose(string name, SurvivePose pose)
+ static void Main(string[] args)
{
- 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();
- }
+ LibSurViveAPI api = LibSurViveAPI.Instance;
- public MyHandler() : base()
- {
- }
-
- public MyHandler(string[] args) : base(args)
- {
+ var so = api.GetSurviveObjectByName("HMD");
+
}
- protected void LightHouseEvent1(IntPtr ctx, byte lighthouse, SurvivePose lighthouse_pose, SurvivePose object_pose)
+ public static void HMDUpdate(int ObjectID, Vector3 pos)
{
- 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
- {
- static void Main(string[] args)
- {
- MyHandler handler = new MyHandler(args);
-
- while (handler.Poll() == 0) {
- }
}