Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
gltf_skeleton_io.h
Go to the documentation of this file.
1/*
2 * Copyright (c) Meta Platforms, Inc. and affiliates.
3 *
4 * This source code is licensed under the MIT license found in the
5 * LICENSE file in the root directory of this source tree.
6 */
7
8#pragma once
9
14
15#include <fx/gltf.h>
16#include <nlohmann/json.hpp>
17
18#include <tuple>
19#include <vector>
20
21namespace momentum {
22
28TaperedCapsule createCollisionCapsule(const fx::gltf::Node& node, const nlohmann::json& extension);
29
36 const fx::gltf::Node& node,
37 const nlohmann::json& extension);
38
44CollisionBox createCollisionBox(const fx::gltf::Node& node, const nlohmann::json& extension);
45
51Locator createLocator(const fx::gltf::Node& node, const nlohmann::json& extension);
52
57Joint createJoint(const fx::gltf::Node& node);
58
66[[nodiscard]] bool isHierarchyNode(const fx::gltf::Node& node);
67
75[[nodiscard]] std::vector<std::vector<uint32_t>> gatherSkeletonRoots(
76 const fx::gltf::Document& model);
77
86std::tuple<
87 std::string,
89 CollisionGeometry_u,
92 std::vector<size_t>>
93loadHierarchy(const fx::gltf::Document& model);
94
99
100} // namespace momentum
bool isHierarchyNode(const fx::gltf::Node &node)
Check if a node is allowed in the skeleton hierarchy.
std::tuple< std::string, JointList, CollisionGeometry_u, LocatorList, PhysicalProperties, std::vector< size_t > > loadHierarchy(const fx::gltf::Document &model)
Load the hierarchy from the model.
Joint createJoint(const fx::gltf::Node &node)
Create a joint from a glTF node.
JointListT< float > JointList
Definition joint.h:81
CollisionEllipsoidT< float > CollisionEllipsoid
Definition fwd.h:168
CollisionBox createCollisionBox(const fx::gltf::Node &node, const nlohmann::json &extension)
Create a collision box from a glTF node.
JointList createSkeletonWithOnlyRoot()
Create a skeleton with only a root joint.
Locator createLocator(const fx::gltf::Node &node, const nlohmann::json &extension)
Create a locator from a glTF node.
CollisionEllipsoid createCollisionEllipsoid(const fx::gltf::Node &node, const nlohmann::json &extension)
Create a collision ellipsoid from a glTF node.
TaperedCapsule createCollisionCapsule(const fx::gltf::Node &node, const nlohmann::json &extension)
Create a collision capsule from a glTF node.
std::vector< JointPhysicalProperties > PhysicalProperties
Optional physical mass properties for a character.
Definition joint.h:114
CollisionBoxT< float > CollisionBox
Definition fwd.h:187
std::vector< std::vector< uint32_t > > gatherSkeletonRoots(const fx::gltf::Document &model)
Gather skeleton roots from the glTF model.
JointT< float > Joint
Definition fwd.h:206
TaperedCapsuleT< float > TaperedCapsule
Definition fwd.h:320
std::vector< Locator > LocatorList
A collection of locators attached to a skeleton.
Definition locator.h:79
Represents a point attached to a joint in a skeleton.
Definition locator.h:19