Blender V5.0
GHOST_XrControllerModel.hh
Go to the documentation of this file.
1/* SPDX-FileCopyrightText: 2021-2023 Blender Authors
2 *
3 * SPDX-License-Identifier: GPL-2.0-or-later */
4
8
9/* NOTE: Requires OpenXR headers to be included before this one for OpenXR types (XrInstance,
10 * XrSession, etc.). */
11
12#pragma once
13
14#include <atomic>
15#include <future>
16#include <vector>
17
19
24 public:
25 GHOST_XrControllerModel(XrInstance instance, const char *subaction_path);
27
28 void load(XrSession session);
29 void updateComponents(XrSession session);
30 void getData(GHOST_XrControllerModelData &r_data);
31
32 private:
33 XrPath subaction_path_ = XR_NULL_PATH;
34 XrControllerModelKeyMSFT model_key_ = XR_NULL_CONTROLLER_MODEL_KEY_MSFT;
35
36 std::future<void> load_task_;
37 std::atomic<bool> data_loaded_ = false;
38
39 std::vector<GHOST_XrControllerModelVertex> vertices_;
40 std::vector<uint32_t> indices_;
41 std::vector<GHOST_XrControllerModelComponent> components_;
42 std::vector<GHOST_XrControllerModelNode> nodes_;
44 std::vector<int32_t> node_state_indices_;
45
46 void loadControllerModel(XrSession session);
47};
void updateComponents(XrSession session)
GHOST_XrControllerModel(XrInstance instance, const char *subaction_path)
void getData(GHOST_XrControllerModelData &r_data)