Momentum
A library for solving nonlinear optimization problems related to human body kinematics
Loading...
Searching...
No Matches
bvh_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#include <momentum/math/types.h>
14
15#include <span>
16#include <tuple>
17#include <vector>
18
19namespace momentum {
20
28[[nodiscard]] Character loadBvhCharacter(const filesystem::path& filepath);
29
34[[nodiscard]] Character loadBvhCharacter(std::span<const std::byte> bytes);
35
44[[nodiscard]] std::tuple<Character, MotionParameters, float> loadBvhCharacterWithMotion(
45 const filesystem::path& filepath);
46
51[[nodiscard]] std::tuple<Character, MotionParameters, float> loadBvhCharacterWithMotion(
52 std::span<const std::byte> bytes);
53
62void saveBvhCharacter(const filesystem::path& filepath, const Character& character);
63
74 const filesystem::path& filepath,
75 const Character& character,
76 const MotionParameters& motionParams,
77 float fps);
78
85[[nodiscard]] std::vector<std::byte> saveBvhCharacterWithMotion(
86 const Character& character,
87 const MotionParameters& motionParams,
88 float fps);
89
90} // namespace momentum
void saveBvhCharacter(const filesystem::path &filepath, const Character &character)
Saves a character to a BVH file with a single rest-pose frame.
Definition bvh_io.cpp:655
Character loadBvhCharacter(const filesystem::path &filepath)
Loads a character from a BVH (BioVision Hierarchy) file.
Definition bvh_io.cpp:629
std::tuple< std::vector< std::string >, Eigen::MatrixXf > MotionParameters
A tuple of model parameter names and a matrix of poses across a sequence of frames.
Definition types.h:173
void saveBvhCharacterWithMotion(const filesystem::path &filepath, const Character &character, const MotionParameters &motionParams, float fps)
Saves a character with motion data to a BVH file.
Definition bvh_io.cpp:666
std::tuple< Character, MotionParameters, float > loadBvhCharacterWithMotion(const filesystem::path &filepath)
Loads a character with motion data from a BVH (BioVision Hierarchy) file.
Definition bvh_io.cpp:642
A character model with skeletal structure, mesh, and optional components.
Definition character.h:32