[dali_2.3.21] Merge branch 'devel/master'
[platform/core/uifw/dali-toolkit.git] / dali-scene3d / internal / algorithm / navigation-mesh-header.h
1 #ifndef DALI_SCENE3D_NAVIGATION_MESH_HEADER_H
2 #define DALI_SCENE3D_NAVIGATION_MESH_HEADER_H
3 /*
4  * Copyright (c) 2023 Samsung Electronics Co., Ltd.
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18
19 // EXTERNAL INCLUDES
20 #include <inttypes.h>
21
22 namespace Dali::Scene3D::Internal::Algorithm
23 {
24 /**
25  * @struct NavigationMeshHeader
26  *
27  * Base header structure contains only the version field. It will allow adding changes to the
28  * exporter while maintaining backward compatibility.
29  */
30 struct NavigationMeshHeader
31 {
32   uint32_t checksum; ///< Checksum (used to test for endianness, tested by reader )
33   uint32_t version;  ///< Version of the API
34 };
35
36 /**
37  * @struct NavigationMeshHeader_V10
38  *
39  * Extension of header for version 1.0 of NavigationMesh binary file
40  */
41 struct NavigationMeshHeader_V10 : public NavigationMeshHeader
42 {
43   uint32_t dataOffset; ///< Offset where data starts (depends on endianness)
44
45   uint32_t vertexCount;      ///< total count of vertices
46   uint32_t vertexDataOffset; ///< offset into data array where vertices start
47
48   uint32_t edgeCount;      ///< total count of edges
49   uint32_t edgeDataOffset; ///< offset into data array where edges are stored
50
51   uint32_t polyCount;      ///< total number of polys
52   uint32_t polyDataOffset; ///< offset into data array where edges are stored
53
54   float gravityVector[3]; /// Gravity vector for the data (down vector)
55 };
56
57 }
58 #endif // DALI_SCENE3D_NAVIGATION_MESH_HEADER_H