#define DALI_SCENE3D_NAVIGATION_MESH_H
/*
- * Copyright (c) 2023 Samsung Electronics Co., Ltd.
+ * Copyright (c) 2024 Samsung Electronics Co., Ltd.
*
* Licensed under the Apache License, Version 2.0 (the "License");
* you may not use this file except in compliance with the License.
#include <cinttypes>
#include <cstdio>
+#include <limits>
#include <memory>
// INTERNAL INCLUDES
/**
* @brief Looks for the floor under specified position
* @param[in] position Position to investigate
- * @param[in] outPosition Position on the floor in found
- * @param[out] faceIndex Index of NavigationMesh face associated with floor
+ * @param[out] outPosition Position on the floor in found
+ * @param[out] outFaceIndex Index of NavigationMesh face associated with floor
*
* @return True if floor has been found, False otherwise
*/
- bool FindFloor(const Dali::Vector3& position, Dali::Vector3& outPosition, FaceIndex& faceIndex);
+ bool FindFloor(const Dali::Vector3& position, Dali::Vector3& outPosition, FaceIndex& outFaceIndex);
/**
* @brief Looks for a floor starting from specified face
*/
Dali::Vector3 GetGravityVector() const;
+ /**
+ * @brief Performs ray/face intersect test
+ * @param[in] origin Origin of ray
+ * @param[in] direction Direction of ray
+ *
+ * @SINCE_2_2.53
+ * @return Valid FaceIndex on hit or NULL_FACE on miss
+ */
+ [[nodiscard]] FaceIndex RayFaceIntersect(const Vector3& origin, const Vector3& direction) const;
+
static constexpr FaceIndex NULL_FACE{std::numeric_limits<FaceIndex>::max()}; ///< Represents null face
static constexpr EdgeIndex NULL_EDGE{std::numeric_limits<EdgeIndex>::max()}; ///< Represents null edge
std::unique_ptr<NavigationMeshImpl> mImpl;
};
+
+// Alias name for collider mesh
+// TODO: currently ColliderMesh is NavigationMesh however
+// there should be separation from data and algorithms.
+// Both, NavigationMesh and ColliderMesh use the same
+// data structures but differ in the way they use data.
+using ColliderMesh = NavigationMesh;
+
} // namespace Dali::Scene3D::Algorithm
#endif // DALI_SCENE3D_NAVIGATION_MESH_H