//====================================================================================================== // Copyright 2025, Rokoko Glove OptiTrack Integration //====================================================================================================== /** * RokokoData.h defines the data structures for Rokoko Studio LiveFrame_v4 format. * These structures match the JSON format used by Rokoko Unity scripts. */ #pragma once #include #include #include namespace RokokoData { // Vector3 structure for position data struct Vector3Frame { float x = 0.0f; float y = 0.0f; float z = 0.0f; }; // Vector4 structure for quaternion rotation data struct Vector4Frame { float x = 0.0f; float y = 0.0f; float z = 0.0f; float w = 1.0f; }; // Actor joint frame containing position and rotation struct ActorJointFrame { Vector3Frame position; Vector4Frame rotation; }; // Body structure containing finger joints struct Body { // Left hand finger joints std::shared_ptr leftThumbProximal; std::shared_ptr leftThumbMedial; std::shared_ptr leftThumbDistal; std::shared_ptr leftThumbTip; std::shared_ptr leftIndexProximal; std::shared_ptr leftIndexMedial; std::shared_ptr leftIndexDistal; std::shared_ptr leftIndexTip; std::shared_ptr leftMiddleProximal; std::shared_ptr leftMiddleMedial; std::shared_ptr leftMiddleDistal; std::shared_ptr leftMiddleTip; std::shared_ptr leftRingProximal; std::shared_ptr leftRingMedial; std::shared_ptr leftRingDistal; std::shared_ptr leftRingTip; std::shared_ptr leftLittleProximal; std::shared_ptr leftLittleMedial; std::shared_ptr leftLittleDistal; std::shared_ptr leftLittleTip; // Right hand finger joints (similar structure) std::shared_ptr rightThumbProximal; std::shared_ptr rightThumbMedial; std::shared_ptr rightThumbDistal; std::shared_ptr rightThumbTip; std::shared_ptr rightIndexProximal; std::shared_ptr rightIndexMedial; std::shared_ptr rightIndexDistal; std::shared_ptr rightIndexTip; std::shared_ptr rightMiddleProximal; std::shared_ptr rightMiddleMedial; std::shared_ptr rightMiddleDistal; std::shared_ptr rightMiddleTip; std::shared_ptr rightRingProximal; std::shared_ptr rightRingMedial; std::shared_ptr rightRingDistal; std::shared_ptr rightRingTip; std::shared_ptr rightLittleProximal; std::shared_ptr rightLittleMedial; std::shared_ptr rightLittleDistal; std::shared_ptr rightLittleTip; }; // Actor data structure struct ActorData { std::string id; std::string name; Body body; }; // Scene structure containing actors struct SceneFrame { std::vector actors; }; // Main LiveFrame_v4 structure struct LiveFrame_v4 { double timestamp = 0.0; SceneFrame scene; }; }