1 /*
2  * Copyright (c) 2024 Huawei Device Co., Ltd.
3  * Licensed under the Apache License, Version 2.0 (the "License");
4  * you may not use this file except in compliance with the License.
5  * You may obtain a copy of the License at
6  *
7  *     http://www.apache.org/licenses/LICENSE-2.0
8  *
9  * Unless required by applicable law or agreed to in writing, software
10  * distributed under the License is distributed on an "AS IS" BASIS,
11  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12  * See the License for the specific language governing permissions and
13  * limitations under the License.
14  */
15 
16 #if !defined(API_3D_ECS_COMPONENTS_ANIMATION_TRACK_COMPONENT_H) || defined(IMPLEMENT_MANAGER)
17 #define API_3D_ECS_COMPONENTS_ANIMATION_TRACK_COMPONENT_H
18 
19 #if !defined(IMPLEMENT_MANAGER)
20 #include <3d/namespace.h>
21 #include <base/containers/string.h>
22 #include <base/util/uid.h>
23 #include <core/ecs/component_struct_macros.h>
24 #include <core/ecs/entity_reference.h>
25 #include <core/ecs/intf_component_manager.h>
26 
27 CORE3D_BEGIN_NAMESPACE()
28 #endif
29 
30 /**
31  * Properties of a single animation track.
32  */
33 BEGIN_COMPONENT(IAnimationTrackComponentManager, AnimationTrackComponent)
34 #if !defined(IMPLEMENT_MANAGER)
35     /**
36      * Animation interpolation types. Can be one of the following:
37      * step, linear and spline
38      */
39     enum class Interpolation : uint8_t {
40         /** Interpolation type step */
41         STEP,
42         /** Interpolation type linear */
43         LINEAR,
44         /** Interpolation type spline */
45         SPLINE
46     };
47 #endif
48     /** Animation target */
49     DEFINE_PROPERTY(CORE_NS::EntityReference, target, "Target Entity", 0, )
50     /** Component type to animate */
51     DEFINE_PROPERTY(BASE_NS::Uid, component, "Target Component UID", 0, )
52     /** Property to animate. */
53     DEFINE_PROPERTY(BASE_NS::string, property, "Target Property", 0, )
54     /** Animation interpolation mode */
55     DEFINE_PROPERTY(Interpolation, interpolationMode, "Interpolation Mode", 0, )
56     /** Animation timestamps */
57     DEFINE_PROPERTY(CORE_NS::EntityReference, timestamps, "Input Component", 0, )
58     /** Animation data */
59     DEFINE_PROPERTY(CORE_NS::EntityReference, data, "Output Component", 0, )
60 
61 END_COMPONENT(IAnimationTrackComponentManager, AnimationTrackComponent, "42b5784a-44e6-4de1-8892-d0871ebca989")
62 #if !defined(IMPLEMENT_MANAGER)
63 CORE3D_END_NAMESPACE()
64 #endif
65 #endif // API_3D_ECS_COMPONENTS_ANIMATION_TRACK_COMPONENT_H
66