Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
gltf_animation_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
13
14#include <fx/gltf.h>
15
16#include <span>
17#include <tuple>
18#include <variant>
19#include <vector>
20
21namespace momentum {
22
27std::tuple<MotionParameters, IdentityParameters> getMotionFromModel(fx::gltf::Document& model);
28
33float calculateFpsFromAnimationData(const fx::gltf::Document& model);
34
39std::tuple<MotionParameters, IdentityParameters, float> loadMotionFromModel(
40 fx::gltf::Document& model);
41
47std::tuple<Character, MatrixXf, JointParameters, float> loadCharacterWithMotionCommon(
48 const std::variant<filesystem::path, std::span<const std::byte>>& input,
49 bool mapParameters = false);
50
56std::tuple<MatrixXf, JointParameters, float> loadMotionOnCharacterCommon(
57 const std::variant<filesystem::path, std::span<const std::byte>>& input,
58 const Character& character);
59
64std::tuple<Character, std::vector<SkeletonState>, std::vector<float>>
66 const std::variant<filesystem::path, std::span<const std::byte>>& input);
67
68} // namespace momentum
std::tuple< MotionParameters, IdentityParameters > getMotionFromModel(fx::gltf::Document &model)
Get motion parameters from a glTF model.
float calculateFpsFromAnimationData(const fx::gltf::Document &model)
Calculate FPS from glTF animation data.
std::tuple< MatrixXf, JointParameters, float > loadMotionOnCharacterCommon(const std::variant< filesystem::path, std::span< const std::byte > > &input, const Character &character)
Load motion onto a character (common implementation).
std::tuple< Character, std::vector< SkeletonState >, std::vector< float > > loadCharacterWithSkeletonStatesCommon(const std::variant< filesystem::path, std::span< const std::byte > > &input)
Load character with skeleton states from input (common implementation).
std::tuple< Character, MatrixXf, JointParameters, float > loadCharacterWithMotionCommon(const std::variant< filesystem::path, std::span< const std::byte > > &input, bool mapParameters)
Load character with motion from input (common implementation).
Eigen::VectorX< T > mapParameters(const ModelParametersT< T > &in, const std::vector< size_t > &mp)
std::tuple< MotionParameters, IdentityParameters, float > loadMotionFromModel(fx::gltf::Document &model)
Load motion data from a glTF model.
A character model with skeletal structure, mesh, and optional components.
Definition character.h:32