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_PREVIOUS_JOINT_MATRICES_COMPONENT_H) || defined(IMPLEMENT_MANAGER)
17 #define API_3D_ECS_COMPONENTS_PREVIOUS_JOINT_MATRICES_COMPONENT_H
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 
CORE3D_BEGIN_NAMESPACE()25 CORE3D_BEGIN_NAMESPACE()
26 namespace {
27 #include <3d/shaders/common/3d_dm_structures_common.h>
28 }
29 #endif
30 /** Contains the previous joint matrices of a skinned entity.
31  */
32 BEGIN_COMPONENT(IPreviousJointMatricesComponentManager, PreviousJointMatricesComponent)
33 
34     /**
35      * Number of valid entries in jointMatrices array.
36      */
37     DEFINE_PROPERTY(size_t, count, "Number Of Matrices", 0, 0)
38 
39     /**
40      * Joint matrices for the skinned entity. SkinningSystem calculates the joint matrices
41      */
42     DEFINE_ARRAY_PROPERTY(
43         BASE_NS::Math::Mat4X4, CORE_DEFAULT_MATERIAL_MAX_JOINT_COUNT, jointMatrices, "Joint Matrices", 0, ARRAY_VALUE())
44 
45 END_COMPONENT(
46     IPreviousJointMatricesComponentManager, PreviousJointMatricesComponent, "7f1327fc-7869-4952-aa87-3b55f40c8a80")
47 #if !defined(IMPLEMENT_MANAGER)
48 CORE3D_END_NAMESPACE()
49 #endif
50 
51 #endif