From 8923bd3f257e092185adf3a6fc079df56e9a9197 Mon Sep 17 00:00:00 2001 From: Cassandra de la Cruz-Munoz Date: Thu, 17 Aug 2023 14:13:43 -0400 Subject: [PATCH] create ToMessage() for VmcExtCam --- VmcMessages/VmcExtCam.cs | 16 ++++++++++++++++ 1 file changed, 16 insertions(+) diff --git a/VmcMessages/VmcExtCam.cs b/VmcMessages/VmcExtCam.cs index 75d9119..e6ca9ee 100644 --- a/VmcMessages/VmcExtCam.cs +++ b/VmcMessages/VmcExtCam.cs @@ -90,5 +90,21 @@ namespace godotVmcSharp Transform = transform; Fov = fov; } + + public new godotOscSharp.OscMessage ToMessage() + { + var quat = Transform.Basis.GetRotationQuaternion(); + return new godotOscSharp.OscMessage(addr, new System.Collections.Generic.List{ + new godotOscSharp.OscArgument(Name, 's'), + new godotOscSharp.OscArgument(Transform.Origin.X, 'f'), + new godotOscSharp.OscArgument(Transform.Origin.Y, 'f'), + new godotOscSharp.OscArgument(Transform.Origin.Z, 'f'), + new godotOscSharp.OscArgument(quat.X, 'f'), + new godotOscSharp.OscArgument(quat.Y, 'f'), + new godotOscSharp.OscArgument(quat.Z, 'f'), + new godotOscSharp.OscArgument(quat.W, 'f'), + new godotOscSharp.OscArgument(Fov, 'f') + }); + } } }