mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-11-21 06:14:58 +01:00
Fields: the vertices handed to the geometry of the water by value
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01DDcMn1Q7wdYkbxDUWscNHZ
This commit is contained in:
@@ -2443,7 +2443,7 @@ void terrain_streamer::clear_water(bool const Touch)
|
||||
m_watershapes.clear();
|
||||
}
|
||||
|
||||
gfx::geometry_handle terrain_streamer::water_geometry(gfx::vertex_array const &Vertices)
|
||||
gfx::geometry_handle terrain_streamer::water_geometry(gfx::vertex_array Vertices)
|
||||
{
|
||||
// the geometry of water made before is filled anew, so editing the water doesn't pile up geometry
|
||||
gfx::userdata_array nouserdata;
|
||||
@@ -2507,7 +2507,7 @@ void terrain_streamer::build_water()
|
||||
reach = std::max(reach, glm::length(point - centroid));
|
||||
}
|
||||
water_shape entry;
|
||||
entry.geometry = water_geometry(vertices);
|
||||
entry.geometry = water_geometry(std::move(vertices));
|
||||
if (entry.geometry.chunk == 0)
|
||||
continue;
|
||||
// two bounding vertices give the shape its area, the triangles are in the geometry
|
||||
@@ -2616,7 +2616,7 @@ void terrain_streamer::build_water()
|
||||
vertices.push_back(vertex);
|
||||
}
|
||||
water_shape entry;
|
||||
entry.geometry = water_geometry(vertices);
|
||||
entry.geometry = water_geometry(std::move(vertices));
|
||||
if (entry.geometry.chunk == 0)
|
||||
continue;
|
||||
auto const reach{glm::length(high - low) * 0.5};
|
||||
|
||||
@@ -306,7 +306,7 @@ class terrain_streamer
|
||||
void build_water();
|
||||
// the vertices of a shape of the water or of a field in the geometry of the water: one made before filled anew, or a new one;
|
||||
// a handle of chunk 0 if it failed
|
||||
gfx::geometry_handle water_geometry(gfx::vertex_array const &Vertices);
|
||||
gfx::geometry_handle water_geometry(gfx::vertex_array Vertices);
|
||||
void clear_water(bool const Touch);
|
||||
std::string pack_path(heightmap::pack_key const &Key) const;
|
||||
// the state of a chunk (null: no chunk) or of the description is kept for the change in progress, if it's the first time
|
||||
|
||||
Reference in New Issue
Block a user