|
Blender V5.3
|
#include <cassert>#include <Eigen/Core>#include <Eigen/Geometry>#include "GHOST_Types.hh"#include "GHOST_XrException.hh"#include "GHOST_Xr_intern.hh"#include "GHOST_XrControllerModel.hh"#include "GHOST_utildefines.hh"#include "tiny_gltf.h"Go to the source code of this file.
Classes | |
| struct | GHOST_XrControllerModelNode |
| struct | GHOST_XrPrimitive |
Macros | |
| #define | TINYGLTF_IMPLEMENTATION |
| #define | TINYGLTF_NO_STB_IMAGE |
| #define | TINYGLTF_NO_STB_IMAGE_WRITE |
| #define | STBIWDEF static inline |
Functions | |
glTF Utilities | |
Adapted from Microsoft OpenXR-Mixed Reality Samples (MIT License): https://github.com/microsoft/OpenXR-MixedReality | |
| static void | validate_accessor (const tinygltf::Accessor &accessor, const tinygltf::BufferView &buffer_view, const tinygltf::Buffer &buffer, size_t byte_stride, size_t element_size) |
| template<float(GHOST_XrControllerModelVertex::*) field> | |
| static void | read_vertices (const tinygltf::Accessor &accessor, const tinygltf::BufferView &buffer_view, const tinygltf::Buffer &buffer, GHOST_XrPrimitive &primitive) |
| static void | load_attribute_accessor (const tinygltf::Model &gltf_model, const std::string &attribute_name, int accessor_id, GHOST_XrPrimitive &primitive) |
| template<typename TSrcIndex> | |
| static void | read_indices (const tinygltf::Accessor &accessor, const tinygltf::BufferView &buffer_view, const tinygltf::Buffer &buffer, GHOST_XrPrimitive &primitive) |
| static void | load_index_accessor (const tinygltf::Model &gltf_model, const tinygltf::Accessor &accessor, GHOST_XrPrimitive &primitive) |
| static GHOST_XrPrimitive | read_primitive (const tinygltf::Model &gltf_model, const tinygltf::Primitive &gltf_primitive) |
| static void | calc_node_transforms (const tinygltf::Node &gltf_node, const float parent_transform[4][4], float r_local_transform[4][4], float r_world_transform[4][4]) |
| static void | load_node (const tinygltf::Model &gltf_model, int gltf_node_id, int32_t parent_idx, const float parent_transform[4][4], const std::string &parent_name, const std::vector< XrControllerModelNodePropertiesMSFT > &node_properties, std::vector< GHOST_XrControllerModelVertex > &vertices, std::vector< uint32_t > &indices, std::vector< GHOST_XrControllerModelComponent > &components, std::vector< GHOST_XrControllerModelNode > &nodes, std::vector< int32_t > &node_state_indices) |
OpenXR Extension Functions | |
| static PFN_xrGetControllerModelKeyMSFT | g_xrGetControllerModelKeyMSFT = nullptr |
| static PFN_xrLoadControllerModelMSFT | g_xrLoadControllerModelMSFT = nullptr |
| static PFN_xrGetControllerModelPropertiesMSFT | g_xrGetControllerModelPropertiesMSFT = nullptr |
| static PFN_xrGetControllerModelStateMSFT | g_xrGetControllerModelStateMSFT = nullptr |
| static XrInstance | g_instance = XR_NULL_HANDLE |
| static void | init_controller_model_extension_functions (XrInstance instance) |
| #define STBIWDEF static inline |
Definition at line 25 of file GHOST_XrControllerModel.cc.
| #define TINYGLTF_IMPLEMENTATION |
Definition at line 22 of file GHOST_XrControllerModel.cc.
| #define TINYGLTF_NO_STB_IMAGE |
Definition at line 23 of file GHOST_XrControllerModel.cc.
| #define TINYGLTF_NO_STB_IMAGE_WRITE |
Definition at line 24 of file GHOST_XrControllerModel.cc.
|
static |
Calculate node local and world transforms.
Definition at line 228 of file GHOST_XrControllerModel.cc.
References calc_node_transforms(), float, scale(), and blender::blender::StringRefBase::size().
Referenced by calc_node_transforms(), and load_node().
|
static |
Definition at line 380 of file GHOST_XrControllerModel.cc.
References g_instance, g_xrGetControllerModelKeyMSFT, g_xrGetControllerModelPropertiesMSFT, g_xrGetControllerModelStateMSFT, g_xrLoadControllerModelMSFT, init_controller_model_extension_functions(), and INIT_EXTENSION_FUNCTION.
Referenced by GHOST_XrControllerModel::GHOST_XrControllerModel(), and init_controller_model_extension_functions().
|
static |
Definition at line 102 of file GHOST_XrControllerModel.cc.
References ELEM, GHOST_XrException::GHOST_XrException(), load_attribute_accessor(), and read_vertices().
Referenced by load_attribute_accessor(), and read_primitive().
|
static |
Reads index data from a glTF primitive into a GHOST_XrPrimitive.
Definition at line 172 of file GHOST_XrControllerModel.cc.
References GHOST_XrException::GHOST_XrException(), load_index_accessor(), and read_indices().
Referenced by load_index_accessor(), and read_primitive().
|
static |
Definition at line 287 of file GHOST_XrControllerModel.cc.
References calc_node_transforms(), GHOST_XrPrimitive::indices, load_node(), node, read_primitive(), and GHOST_XrPrimitive::vertices.
Referenced by load_node().
|
static |
Reads index data from a glTF primitive into a GHOST_XrPrimitive. glTF indices may be 8bit, 16bit or 32bit integers. This will coalesce indices from the source type(s) into a 32bit integer.
Definition at line 136 of file GHOST_XrControllerModel.cc.
References ELEM, GHOST_XrException::GHOST_XrException(), GHOST_XrPrimitive::indices, read_indices(), and validate_accessor().
Referenced by load_index_accessor(), and read_indices().
|
static |
Definition at line 201 of file GHOST_XrControllerModel.cc.
References GHOST_XrException::GHOST_XrException(), load_attribute_accessor(), load_index_accessor(), and read_primitive().
Referenced by load_node(), and read_primitive().
|
static |
Definition at line 70 of file GHOST_XrControllerModel.cc.
References float, GHOST_XrException::GHOST_XrException(), read_vertices(), validate_accessor(), and GHOST_XrPrimitive::vertices.
Referenced by load_attribute_accessor(), and read_vertices().
|
static |
Validate that an accessor does not go out of bounds of the buffer view that it references and that the buffer view does not exceed the bounds of the buffer that it references
Definition at line 50 of file GHOST_XrControllerModel.cc.
References GHOST_XrException::GHOST_XrException(), and validate_accessor().
Referenced by read_indices(), read_vertices(), and validate_accessor().
|
static |
Definition at line 378 of file GHOST_XrControllerModel.cc.
Referenced by init_controller_model_extension_functions().
|
static |
Definition at line 374 of file GHOST_XrControllerModel.cc.
Referenced by init_controller_model_extension_functions(), and GHOST_XrControllerModel::load().
|
static |
Definition at line 376 of file GHOST_XrControllerModel.cc.
Referenced by init_controller_model_extension_functions().
|
static |
Definition at line 377 of file GHOST_XrControllerModel.cc.
Referenced by init_controller_model_extension_functions(), and GHOST_XrControllerModel::updateComponents().
|
static |
Definition at line 375 of file GHOST_XrControllerModel.cc.
Referenced by init_controller_model_extension_functions().