28#ifndef OZZ_OZZ_ANIMATION_OFFLINE_RAW_SKELETON_H_
29#define OZZ_OZZ_ANIMATION_OFFLINE_RAW_SKELETON_H_
31#include "ozz/animation/offline/export.h"
32#include "ozz/base/containers/string.h"
33#include "ozz/base/containers/vector.h"
34#include "ozz/base/io/archive_traits.h"
35#include "ozz/base/maths/transform.h"
61 typedef ozz::vector<Joint> Children;
76 bool Validate()
const;
81 int num_joints()
const;
84 Joint::Children roots;
89template <
typename _Fct>
90inline void _IterHierarchyRecurseDF(
91 const RawSkeleton::Joint::Children& _children,
93 for (
size_t i = 0; i < _children.size(); ++i) {
95 _fct(current, _parent);
96 _IterHierarchyRecurseDF(current.children, ¤t, _fct);
101template <
typename _Fct>
102inline void _IterHierarchyRecurseBF(
103 const RawSkeleton::Joint::Children& _children,
104 const RawSkeleton::Joint* _parent, _Fct& _fct) {
105 for (
size_t i = 0; i < _children.size(); ++i) {
106 const RawSkeleton::Joint& current = _children[i];
107 _fct(current, _parent);
109 for (
size_t i = 0; i < _children.size(); ++i) {
110 const RawSkeleton::Joint& current = _children[i];
111 _IterHierarchyRecurseBF(current.children, ¤t, _fct);
120template <
typename _Fct>
121inline _Fct IterateJointsDF(
const RawSkeleton& _skeleton, _Fct _fct) {
122 _IterHierarchyRecurseDF(_skeleton.roots,
nullptr, _fct);
130template <
typename _Fct>
131inline _Fct IterateJointsBF(
const RawSkeleton& _skeleton, _Fct _fct) {
132 _IterHierarchyRecurseBF(_skeleton.roots,
nullptr, _fct);
138OZZ_IO_TYPE_VERSION(1, animation::offline::RawSkeleton)
139OZZ_IO_TYPE_TAG(
"ozz-raw_skeleton", animation::offline::RawSkeleton)
143struct OZZ_ANIMOFFLINE_DLL
Extern<animation::offline::RawSkeleton> {
144 static void Save(
OArchive& _archive,
147 static void Load(
IArchive& _archive,
Definition raw_skeleton.h:59
Definition raw_skeleton.h:51