/* SPDX-License-Identifier: GPL-2.0-or-later */ /** \file * \ingroup GHOST */ /* NOTE: Requires OpenXR headers to be included before this one for OpenXR types (XrInstance, * XrSession, etc.). */ #pragma once #include #include #include struct GHOST_XrControllerModelNode; /** * OpenXR glTF controller model. */ class GHOST_XrControllerModel { public: GHOST_XrControllerModel(XrInstance instance, const char *subaction_path); ~GHOST_XrControllerModel(); void load(XrSession session); void updateComponents(XrSession session); void getData(GHOST_XrControllerModelData &r_data); private: XrPath m_subaction_path = XR_NULL_PATH; XrControllerModelKeyMSFT m_model_key = XR_NULL_CONTROLLER_MODEL_KEY_MSFT; std::future m_load_task; std::atomic m_data_loaded = false; std::vector m_vertices; std::vector m_indices; std::vector m_components; std::vector m_nodes; /** Maps node states to nodes. */ std::vector m_node_state_indices; void loadControllerModel(XrSession session); };