From 66ad0e3e48ccc915b1d3e8b647001d1d693f5c10 Mon Sep 17 00:00:00 2001 From: Mathieu David Date: Tue, 6 Aug 2024 14:26:49 +0200 Subject: [PATCH] Fix parseModelDef for NatNet >=4.1.0 --- src/optitrack.cpp | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/optitrack.cpp b/src/optitrack.cpp index 2e8f87a..d5a4e5c 100644 --- a/src/optitrack.cpp +++ b/src/optitrack.cpp @@ -113,6 +113,13 @@ namespace libmotioncapture { int type = 0; memcpy(&type, ptr, 4); ptr += 4; // printf("Type : %d\n", i, type); + if ((major == 4 && minor >= 1) || major > 4) + { + // If the NatNet version is 4.1 or greater, next four bytes represent + // the number of bytes in the dataset. Just skip them. + ptr += 4; + } + if(type == 0) // markerset { ptr += strlen(ptr) + 1; // name