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(PREVIOUS_WORLD_MATRIX_COMPONENT) || defined(IMPLEMENT_MANAGER)
17 #define PREVIOUS_WORLD_MATRIX_COMPONENT
18 
19 #if !defined(IMPLEMENT_MANAGER)
20 #include <3d/namespace.h>
21 #include <base/math/matrix.h>
22 #include <core/ecs/component_struct_macros.h>
23 #include <core/ecs/intf_component_manager.h>
24 #include <core/property/property_types.h>
25 
26 CORE3D_BEGIN_NAMESPACE()
27 #endif
28 /** Previous World Matrix component is used to cache the previous world-space transformation of the object and can be
29  * used for example in rendering.
30  */
31 BEGIN_COMPONENT(IPreviousWorldMatrixComponentManager, PreviousWorldMatrixComponent)
32 
33     /** World space transformation of the object.
34      */
35     DEFINE_PROPERTY(BASE_NS::Math::Mat4X4, matrix, "Previous World Matrix", 0, VALUE(BASE_NS::Math::IDENTITY_4X4))
36 
37 END_COMPONENT(
38     IPreviousWorldMatrixComponentManager, PreviousWorldMatrixComponent, "eecc8b2a-9d8f-49ad-811d-07b689b36c03")
39 #if !defined(IMPLEMENT_MANAGER)
40 CORE3D_END_NAMESPACE()
41 #endif
42 
43 #endif
44