RavEngine
Loading...
Searching...
No Matches
additive_animation_builder.h
1//----------------------------------------------------------------------------//
2// //
3// ozz-animation is hosted at http://github.com/guillaumeblanc/ozz-animation //
4// and distributed under the MIT License (MIT). //
5// //
6// Copyright (c) Guillaume Blanc //
7// //
8// Permission is hereby granted, free of charge, to any person obtaining a //
9// copy of this software and associated documentation files (the "Software"), //
10// to deal in the Software without restriction, including without limitation //
11// the rights to use, copy, modify, merge, publish, distribute, sublicense, //
12// and/or sell copies of the Software, and to permit persons to whom the //
13// Software is furnished to do so, subject to the following conditions: //
14// //
15// The above copyright notice and this permission notice shall be included in //
16// all copies or substantial portions of the Software. //
17// //
18// THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR //
19// IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, //
20// FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL //
21// THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER //
22// LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING //
23// FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER //
24// DEALINGS IN THE SOFTWARE. //
25// //
26//----------------------------------------------------------------------------//
27
28#ifndef OZZ_OZZ_ANIMATION_OFFLINE_ADDITIVE_ANIMATION_BUILDER_H_
29#define OZZ_OZZ_ANIMATION_OFFLINE_ADDITIVE_ANIMATION_BUILDER_H_
30
31#include "ozz/animation/offline/export.h"
32#include "ozz/base/platform.h"
33#include "ozz/base/span.h"
34
35namespace ozz {
36
37namespace math {
38struct Transform;
39}
40
41namespace animation {
42namespace offline {
43
44// Forward declare offline animation type.
45struct RawAnimation;
46
47// Defines the class responsible for building a delta animation from an offline
48// raw animation. This is used to create animations compatible with additive
49// blending.
50class OZZ_ANIMOFFLINE_DLL AdditiveAnimationBuilder {
51 public:
52 // Initializes the builder.
54
55 // Builds delta animation from _input..
56 // Returns true on success and fills _output_animation with the delta
57 // version of _input animation.
58 // *_output must be a valid RawAnimation instance. Uses first frame as
59 // reference pose Returns false on failure and resets _output to an empty
60 // animation. See RawAnimation::Validate() for more details about failure
61 // reasons.
62 bool operator()(const RawAnimation& _input, RawAnimation* _output) const;
63
64 // Builds delta animation from _input..
65 // Returns true on success and fills _output_animation with the delta
66 // *_output must be a valid RawAnimation instance.
67 // version of _input animation.
68 // *_reference_pose used as the base pose to calculate deltas from
69 // Returns false on failure and resets _output to an empty animation.
70 bool operator()(const RawAnimation& _input,
71 const span<const math::Transform>& _reference_pose,
72 RawAnimation* _output) const;
73};
74} // namespace offline
75} // namespace animation
76} // namespace ozz
77#endif // OZZ_OZZ_ANIMATION_OFFLINE_ADDITIVE_ANIMATION_BUILDER_H_
Definition additive_animation_builder.h:50
Definition raw_animation.h:59
Definition span.h:37