diff options
author | Rémi Verschelde <rverschelde@gmail.com> | 2024-08-19 16:04:49 +0200 |
---|---|---|
committer | Rémi Verschelde <rverschelde@gmail.com> | 2024-08-19 16:04:49 +0200 |
commit | da57bab16989e2690e1481331d25952b7c342f16 (patch) | |
tree | a7699b1f7b7354917dacc1acaaab5c5fbc19733d /scene/resources/2d/navigation_polygon.h | |
parent | 0ab62a128a12f35cb1e589b8cd33676a385bcc13 (diff) | |
parent | 110b2dc61a95dc59e5aabaaaaeb9ceff63789159 (diff) | |
download | redot-engine-da57bab16989e2690e1481331d25952b7c342f16.tar.gz |
Merge pull request #92560 from smix8/navmesh2d_bake_partition
Add triangulation partition option to 2D navigation mesh baking
Diffstat (limited to 'scene/resources/2d/navigation_polygon.h')
-rw-r--r-- | scene/resources/2d/navigation_polygon.h | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/scene/resources/2d/navigation_polygon.h b/scene/resources/2d/navigation_polygon.h index f43335b397..86bda47ace 100644 --- a/scene/resources/2d/navigation_polygon.h +++ b/scene/resources/2d/navigation_polygon.h @@ -71,6 +71,11 @@ public: Rect2 _edit_get_rect() const; bool _edit_is_selected_on_click(const Point2 &p_point, double p_tolerance) const; #endif + enum SamplePartitionType { + SAMPLE_PARTITION_CONVEX_PARTITION = 0, + SAMPLE_PARTITION_TRIANGULATE, + SAMPLE_PARTITION_MAX + }; enum ParsedGeometryType { PARSED_GEOMETRY_MESH_INSTANCES = 0, @@ -88,6 +93,7 @@ public: real_t agent_radius = 10.0f; + SamplePartitionType partition_type = SAMPLE_PARTITION_CONVEX_PARTITION; ParsedGeometryType parsed_geometry_type = PARSED_GEOMETRY_BOTH; uint32_t parsed_collision_mask = 0xFFFFFFFF; @@ -119,6 +125,9 @@ public: Vector<int> get_polygon(int p_idx); void clear_polygons(); + void set_sample_partition_type(SamplePartitionType p_value); + SamplePartitionType get_sample_partition_type() const; + void set_parsed_geometry_type(ParsedGeometryType p_geometry_type); ParsedGeometryType get_parsed_geometry_type() const; @@ -162,6 +171,7 @@ public: ~NavigationPolygon() {} }; +VARIANT_ENUM_CAST(NavigationPolygon::SamplePartitionType); VARIANT_ENUM_CAST(NavigationPolygon::ParsedGeometryType); VARIANT_ENUM_CAST(NavigationPolygon::SourceGeometryMode); |