• Home
  • Line#
  • Scopes#
  • Navigate#
  • Raw
  • Download
1 /*
2  * Copyright (C) 2023 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(ANIMATION_TRACK_COMPONENT) || defined(IMPLEMENT_MANAGER)
17 #define ANIMATION_TRACK_COMPONENT
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 #include <core/property/property_types.h>
27 
28 CORE3D_BEGIN_NAMESPACE()
29 #endif
30 
31 /**
32  * Properties of a single animation track.
33  */
34 BEGIN_COMPONENT(IAnimationTrackComponentManager, AnimationTrackComponent)
35 #if !defined(IMPLEMENT_MANAGER)
36     /**
37      * Animation interpolation types. Can be one of the following:
38      * step, linear and spline
39      */
40     enum class Interpolation : uint8_t {
41         /** Interpolation type step */
42         STEP,
43         /** Interpolation type linear */
44         LINEAR,
45         /** Interpolation type spline */
46         SPLINE
47     };
48 #endif
49     /** Animation target */
50     DEFINE_PROPERTY(CORE_NS::EntityReference, target, "", 0,)
51     /** Component type to animate */
52     DEFINE_PROPERTY(BASE_NS::Uid, component, "", 0,)
53     /** Property to animate. */
54     DEFINE_PROPERTY(BASE_NS::string, property, "", 0,)
55     /** Animation interpolation mode */
56     DEFINE_PROPERTY(Interpolation, interpolationMode, "", 0,)
57     /** Animation timestamps */
58     DEFINE_PROPERTY(CORE_NS::EntityReference, timestamps, "", 0,)
59     /** Animation data */
60     DEFINE_PROPERTY(CORE_NS::EntityReference, data, "", 0,)
61 
62 END_COMPONENT(IAnimationTrackComponentManager, AnimationTrackComponent, "42b5784a-44e6-4de1-8892-d0871ebca989")
63 #if !defined(IMPLEMENT_MANAGER)
64 CORE3D_END_NAMESPACE()
65 #endif
66 #endif // __ANIMATION_TRACK_COMPONENT__
67