载入中...
搜索中...
未找到
ProcgenPointSetApi.cpp
浏览该文件的文档.
1#include "procgen/Procgen.h"
5
6#include "common/Capability.h"
11
12#include "image/ImageData.h"
13
18
19#include <simplesquirrel/simplesquirrel.hpp>
20
21#include <any>
22#include <cmath>
23#include <cstdint>
24#include <functional>
25#include <memory>
26#include <mutex>
27#include <optional>
28#include <unordered_map>
29#include <utility>
30#include <vector>
31#include "procgen/PointSet.h"
33
34namespace eve::procgen {
35
37 float jitter) {
38 if (width <= 0 || depth <= 0 || spacing <= 0.f)
40 eve::DiagnosticCode::InvalidArgument, "sampleGrid requires positive dimensions and spacing", "pointSet", {},
41 "procgen.squirrel"));
42 return ownProcgenObject(ownership_->points,
43 std::make_unique<PointSet>(sampleGridPoints(width, depth, spacing, seed, jitter)));
44}
45
47 float maxHeight) {
49 if (!view.isBound())
51 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "filterHeight input point-set handle is stale",
52 "input", {}, "procgen.squirrel"));
53 return ownProcgenObject(ownership_->points,
54 std::make_unique<PointSet>(filterPointHeight(*view, minHeight, maxHeight)));
55}
56
58 float maxDensity) {
60 if (!view.isBound())
62 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "filterDensity input point-set handle is stale",
63 "input", {}, "procgen.squirrel"));
64 return ownProcgenObject(ownership_->points,
65 std::make_unique<PointSet>(filterPointDensity(*view, minDensity, maxDensity)));
66}
67
69 float minZ, float maxX, float maxY, float maxZ,
70 bool invert) {
72 if (!view.isBound())
74 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "filterBox input point-set handle is stale",
75 "input", {}, "procgen.squirrel"));
76 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(
77 filterPointBox(*view, minX, minY, minZ, maxX, maxY, maxZ, invert)));
78}
79
81 float maxDegrees) {
83 if (!view.isBound())
85 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "filterSlope input point-set handle is stale",
86 "input", {}, "procgen.squirrel"));
87 return ownProcgenObject(ownership_->points,
88 std::make_unique<PointSet>(filterPointSlope(*view, minDegrees, maxDegrees)));
89}
90
92 ProcgenPointSetHandleRef polygon, bool invert) {
94 auto shape = resolvePointSet(polygon);
95 if (!source.isBound() || !shape.isBound())
97 eve::DiagnosticCode::StaleHandle, "filterPolygon input handle is stale", "input", {}, "procgen.squirrel"));
98 return ownProcgenObject(ownership_->points,
99 std::make_unique<PointSet>(filterPointsByPolygon(*source, *shape, invert)));
100}
101
103 ProcgenPointSetHandleRef controlPoints,
104 float minDistance, float maxDistance) {
106 auto control = resolvePointSet(controlPoints);
107 if (!source.isBound() || !control.isBound())
109 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "filterSplineDistance input handle is stale",
110 "input", {}, "procgen.squirrel"));
111 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(filterPointsBySplineDistance(
112 *source, *control, minDistance, maxDistance)));
113}
114
116 float radius) {
117 auto view = resolvePointSet(input);
118 if (!view.isBound())
120 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "excludeRadius input point-set handle is stale",
121 "input", {}, "procgen.squirrel"));
122 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(excludePointRadius(*view, x, z, radius)));
123}
124
126 float amountX, float amountZ) {
127 auto view = resolvePointSet(input);
128 if (!view.isBound())
130 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "jitterPoints input point-set handle is stale",
131 "input", {}, "procgen.squirrel"));
132 return ownProcgenObject(ownership_->points,
133 std::make_unique<PointSet>(jitterPointPositions(*view, seed, amountX, amountZ)));
134}
135
137 auto view = resolvePointSet(input);
138 if (!view.isBound())
140 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "selfPrune input point-set handle is stale",
141 "input", {}, "procgen.squirrel"));
142 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(selfPrunePoints(*view, radius)));
143}
144
147 float originX, float originZ, float cellSize,
148 float heightScale) {
150 auto map = resolveHeightmap(heightmap);
151 if (!points.isBound() || !map.isBound())
153 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "projectToHeightmap input handle is stale",
154 "input", {}, "procgen.squirrel"));
155 if (cellSize <= 0.f)
157 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "projectToHeightmap cellSize must be positive",
158 "cellSize", {}, "procgen.squirrel"));
159 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(projectPointsToHeightmap(
160 *points, *map, originX, originZ, cellSize, heightScale)));
161}
162
164 uint32_t seed, float lateralJitter) {
165 auto control = resolvePointSet(controlPoints);
166 if (!control.isBound())
168 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "sampleSpline control point-set handle is stale",
169 "controlPoints", {}, "procgen.squirrel"));
170 if (spacing <= 0.f)
172 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "sampleSpline spacing must be positive",
173 "spacing", {}, "procgen.squirrel"));
174 return ownProcgenObject(ownership_->points,
175 std::make_unique<PointSet>(samplePolylinePoints(*control, spacing, seed, lateralJitter)));
176}
177
180 auto a = resolvePointSet(first);
181 auto b = resolvePointSet(second);
182 if (!a.isBound() || !b.isBound())
184 eve::DiagnosticCode::StaleHandle, "mergePoints input handle is stale", "points", {}, "procgen.squirrel"));
185 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(mergePointSets(*a, *b)));
186}
187
190 auto a = resolvePointSet(first);
191 auto b = resolvePointSet(second);
192 if (!a.isBound() || !b.isBound())
194 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "unionPoints requires live point sets", "points",
195 {}, "procgen.squirrel"));
196 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(unionPointSets(*a, *b)));
197}
198
201 auto a = resolvePointSet(first);
202 auto b = resolvePointSet(second);
203 if (!a.isBound() || !b.isBound())
205 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "intersectPoints requires live point sets",
206 "points", {}, "procgen.squirrel"));
207 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(intersectPointSets(*a, *b)));
208}
209
212 auto a = resolvePointSet(first);
213 auto b = resolvePointSet(second);
214 if (!a.isBound() || !b.isBound())
216 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "differencePoints requires live point sets",
217 "points", {}, "procgen.squirrel"));
218 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(differencePointSets(*a, *b)));
219}
220
222 float translateY, float translateZ,
223 float yawDegrees, float scaleX, float scaleY,
224 float scaleZ) {
225 auto view = resolvePointSet(input);
226 if (!view.isBound())
228 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "transformPoints input handle is stale", "input",
229 {}, "procgen.squirrel"));
230 return ownProcgenObject(ownership_->points,
231 std::make_unique<PointSet>(transformPointSet(*view, translateX, translateY, translateZ,
232 yawDegrees, scaleX, scaleY, scaleZ)));
233}
234
236 float translateY, float translateZ,
237 float pitchDegrees, float yawDegrees,
238 float rollDegrees, float scaleX, float scaleY,
239 float scaleZ) {
240 auto view = resolvePointSet(input);
241 if (!view.isBound())
243 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "transformPoints3D input handle is stale", "input",
244 {}, "procgen.squirrel"));
245 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(transformPointSet3D(
246 *view, translateX, translateY, translateZ, pitchDegrees, yawDegrees,
247 rollDegrees, scaleX, scaleY, scaleZ)));
248}
249
252 bool inheritTargetAttributes) {
253 auto sourceView = resolvePointSet(source);
254 auto targetView = resolvePointSet(targets);
255 if (!sourceView.isBound() || !targetView.isBound())
257 eve::DiagnosticCode::StaleHandle, "copyPoints requires live point sets", "points", {}, "procgen.squirrel"));
258 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(copyPointsToTargets(
259 *sourceView, *targetView, inheritTargetAttributes)));
260}
261
263 float inputMax, float outputMin, float outputMax,
264 bool clampOutput) {
265 auto view = resolvePointSet(input);
266 if (!view.isBound())
268 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "remapDensity point-set handle is stale", "points",
269 {}, "procgen.squirrel"));
270 if (!std::isfinite(inputMin) || !std::isfinite(inputMax) || inputMin == inputMax || !std::isfinite(outputMin) ||
271 !std::isfinite(outputMax))
273 eve::DiagnosticCode::InvalidArgument, "remapDensity requires finite non-zero input range", "inputRange", {},
274 "procgen.squirrel"));
275 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(remapPointDensity(
276 *view, inputMin, inputMax, outputMin, outputMax, clampOutput)));
277}
278
280 const std::string& attribute,
281 const std::string& outputAttribute,
282 const std::string& operation, float operand,
283 float defaultValue) {
284 auto view = resolvePointSet(input);
285 if (!view.isBound())
287 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "mathFloatAttribute point-set handle is stale",
288 "points", {}, "procgen.squirrel"));
289 if (attribute.empty() || outputAttribute.empty() ||
290 (operation != "add" && operation != "subtract" && operation != "multiply" && operation != "divide" &&
291 operation != "min" && operation != "max") ||
292 (operation == "divide" && operand == 0.f))
295 "mathFloatAttribute requires a supported operation and valid attributes",
296 "operation", {}, "procgen.squirrel"));
297 return ownProcgenObject(ownership_->points,
298 std::make_unique<PointSet>(mathPointFloatAttribute(*view, attribute, outputAttribute,
299 operation, operand, defaultValue)));
300}
301
303 const std::string& name, float minValue,
304 float maxValue, bool invert) {
305 auto view = resolvePointSet(input);
306 if (!view.isBound() || name.empty())
309 "filterFloatAttribute requires a live input and attribute name", "input", {}, "procgen.squirrel"));
310 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(filterPointFloatAttribute(
311 *view, name, minValue, maxValue, invert)));
312}
313
315 const std::string& name,
316 const std::string& value, bool invert) {
317 auto view = resolvePointSet(input);
318 if (!view.isBound() || name.empty())
321 "filterStringAttribute requires a live input and attribute name", "input", {}, "procgen.squirrel"));
322 return ownProcgenObject(ownership_->points,
323 std::make_unique<PointSet>(filterPointStringAttribute(*view, name, value, invert)));
324}
325
327 ProcgenPointSetHandleRef input, ProcgenGridHandleRef mask, float originX, float originZ, float cellSize,
328 int semantic, float clearance, int maximumChecks) {
330 auto grid = resolve(mask);
331 if (!points.isBound() || !grid.isBound())
332 return procgenBindingFailure<ProcgenPointSetHandleRef>(eve::DiagnosticCode::StaleHandle,
333 "excludeGridMask handle is stale", "input");
334 if (maximumChecks <= 0)
335 return procgenBindingFailure<ProcgenPointSetHandleRef>(eve::DiagnosticCode::InvalidArgument,
336 "excludeGridMask requires a positive work budget",
337 "maximumChecks");
338 auto filtered = excludePointsByGridMask(*points, *grid, originX, originZ, cellSize, semantic, clearance,
339 static_cast<std::size_t>(maximumChecks));
340 if (!filtered.ok()) return eve::Result<ProcgenPointSetHandleRef>::failure(filtered.status());
341 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(std::move(filtered).takeValue()));
342}
343
345 float multiplier) {
346 auto view = resolvePointSet(input);
347 if (!view.isBound())
349 eve::DiagnosticCode::StaleHandle, "densityCull input handle is stale", "input", {}, "procgen.squirrel"));
350 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(densityCullPoints(*view, seed, multiplier)));
351}
352
354 float minY, std::uint64_t maskBits,
355 bool keepUnmatched) {
357 if (!points.isBound())
359 eve::Diagnostic::error(eve::DiagnosticCode::StaleHandle, "projectToWorld point-set handle is stale",
360 "points", {}, "procgen.squirrel"));
361 if (!std::isfinite(maxY) || !std::isfinite(minY) || maxY < minY)
363 eve::Diagnostic::error(eve::DiagnosticCode::InvalidArgument, "projectToWorld requires finite maxY >= minY",
364 "maxY", {}, "procgen.squirrel"));
365 auto* query = eve::cap::query<eve::IProcgenWorldQuery>();
366 if (!query)
368 eve::DiagnosticCode::Unsupported, "projectToWorld requires an IProcgenWorldQuery provider", "worldQuery",
369 {}, "procgen.squirrel"));
370
372 output.reserve(points->points().size());
373 for (size_t sourceIndex = 0; sourceIndex < points->points().size(); ++sourceIndex) {
374 const auto& source = points->points()[sourceIndex];
375 auto queryResult = query->projectDown(source.x, source.z, maxY, minY, maskBits);
376 if (!queryResult.ok())
378 eve::Diagnostic::error(eve::DiagnosticCode::Failed, "world-query provider failed to execute projection",
379 "worldQuery", {}, "procgen.squirrel"));
380 const auto& hit = queryResult.value();
381 if (!hit.hit) {
382 if (keepUnmatched)
383 std::move(output.appendPointFrom(*points, sourceIndex)).expect("projectToWorld attribute schema");
384 continue;
385 }
386 ProcgenPoint projected = source;
387 projected.x = hit.x;
388 projected.y = hit.y;
389 projected.z = hit.z;
390 projected.normalX = hit.normalX;
391 projected.normalY = hit.normalY;
392 projected.normalZ = hit.normalZ;
393 const int outputIndex =
394 std::move(output.appendPointFrom(*points, sourceIndex)).expect("projectToWorld attribute schema");
395 output.mutablePoint(size_t(outputIndex)) = std::move(projected);
396 output.trySetIntAttribute(outputIndex, "worldObjectId", hit.objectId).expect("projectToWorld metadata schema");
397 }
398 return ownProcgenObject(ownership_->points, std::make_unique<PointSet>(std::move(output)));
399}
400
402 int maxPoints) {
403 if (width < 0 || depth < 0 || radius <= 0.f || maxPoints < 0)
406 "poissonDisk requires non-negative dimensions/count and a positive radius", {}, {}, "procgen.squirrel"));
407 return ownProcgenObject(ownership_->points,
408 std::make_unique<PointSet>(poissonDiskPoints(width, depth, radius, seed, maxPoints)));
409}
410
411
412} // namespace eve::procgen
double z
double x
ActionParameterOperation operation
std::string output
int mask
std::string name
Definition ECS.cpp:154
EvpackChunkInput input
Definition Evpack.cpp:170
std::vector< FieldTarget > targets
ShaderImageInput shape
std::int32_t second
std::int32_t first
std::uint32_t width
double defaultValue
MeleePoint3 b
Definition MeleeHit.cpp:41
double radius
Definition MeleeHit.cpp:42
MeleePoint3 a
Definition MeleeHit.cpp:40
OceanSprayView view
std::shared_ptr< const std::vector< glm::vec2 > > points
bool hit
Object::Ptr value
std::string attribute
uint32_t semantic
std::string_view source
The single Squirrel projection for common Result, Status and Value.
int spacing
uint32_t seed
Definition TreeMesh.cpp:276
float size
Definition TreeMesh.cpp:158
std::uint32_t depth
float heightScale
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={})
Construct an error diagnostic with the standard error severity.
Move-only operation result carrying either a value or Status.
Definition Result.h:176
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:196
Script-friendly collection of attributed 3D samples.
Definition PointSet.h:59
void reserve(std::size_t count)
Reserve point storage without changing point or attribute row counts.
Definition PointSet.cpp:61
eve::Result< ProcgenPointSetHandleRef > excludeRadiusHandle(ProcgenPointSetHandleRef input, float x, float z, float radius)
Exclude radius handle.
eve::Result< ProcgenPointSetHandleRef > filterDensityHandle(ProcgenPointSetHandleRef input, float minDensity, float maxDensity)
Filter density handle.
eve::Result< ProcgenPointSetHandleRef > poissonDiskHandle(int width, int depth, float radius, uint32_t seed, int maxPoints)
Poisson disk handle.
eve::Result< ProcgenPointSetHandleRef > mergePointsHandle(ProcgenPointSetHandleRef first, ProcgenPointSetHandleRef second)
Merge points handle.
static eve::script::Borrowed< Params > resolve(ProcgenParamsHandleRef reference) noexcept
Resolves parameters as a non-owning observation.
eve::Result< ProcgenPointSetHandleRef > filterHeightHandle(ProcgenPointSetHandleRef input, float minHeight, float maxHeight)
Filter height handle.
eve::Result< ProcgenPointSetHandleRef > sampleGridHandle(int width, int depth, float spacing, uint32_t seed, float jitter)
eve::Result< ProcgenPointSetHandleRef > filterStringAttributeHandle(ProcgenPointSetHandleRef input, const std::string &name, const std::string &value, bool invert)
Filter string attribute handle.
eve::Result< ProcgenPointSetHandleRef > densityCullHandle(ProcgenPointSetHandleRef input, uint32_t seed, float multiplier)
Density cull handle.
eve::Result< ProcgenPointSetHandleRef > selfPruneHandle(ProcgenPointSetHandleRef input, float radius)
Self prune handle.
eve::Result< ProcgenPointSetHandleRef > filterSplineDistanceHandle(ProcgenPointSetHandleRef input, ProcgenPointSetHandleRef controlPoints, float minDistance, float maxDistance)
Filter spline distance handle.
eve::Result< ProcgenPointSetHandleRef > sampleSplineHandle(ProcgenPointSetHandleRef controlPoints, float spacing, uint32_t seed, float lateralJitter)
Sample spline handle.
eve::Result< ProcgenPointSetHandleRef > unionPointsHandle(ProcgenPointSetHandleRef first, ProcgenPointSetHandleRef second)
Union points handle.
eve::Result< ProcgenPointSetHandleRef > filterSlopeHandle(ProcgenPointSetHandleRef input, float minDegrees, float maxDegrees)
Filter slope handle.
eve::Result< ProcgenPointSetHandleRef > transformPointsHandle(ProcgenPointSetHandleRef input, float translateX, float translateY, float translateZ, float yawDegrees, float scaleX, float scaleY, float scaleZ)
Transform points handle.
eve::Result< ProcgenPointSetHandleRef > filterPolygonHandle(ProcgenPointSetHandleRef input, ProcgenPointSetHandleRef polygon, bool invert=false)
Filter polygon handle.
eve::Result< ProcgenPointSetHandleRef > copyPointsHandle(ProcgenPointSetHandleRef source, ProcgenPointSetHandleRef targets, bool inheritTargetAttributes)
Copies points handle.
eve::script::Borrowed< PointSet > resolvePointSet(ProcgenPointSetHandleRef reference) noexcept
Resolves a point set as a borrowed view.
eve::Result< ProcgenPointSetHandleRef > excludeGridMaskHandle(ProcgenPointSetHandleRef input, ProcgenGridHandleRef mask, float originX, float originZ, float cellSize, int semantic, float clearance, int maximumChecks)
Filter owned points against an owned semantic grid mask with a bounded clearance search.
eve::Result< ProcgenPointSetHandleRef > projectToWorldHandle(ProcgenPointSetHandleRef input, float maxY, float minY, std::uint64_t maskBits, bool keepUnmatched)
Project points through the optional world-query capability.
eve::Result< ProcgenPointSetHandleRef > intersectPointsHandle(ProcgenPointSetHandleRef first, ProcgenPointSetHandleRef second)
Intersect points handle.
eve::Result< ProcgenPointSetHandleRef > jitterPointsHandle(ProcgenPointSetHandleRef input, uint32_t seed, float amountX, float amountZ)
Jitter points handle.
eve::script::Borrowed< Heightmap > resolveHeightmap(ProcgenHeightmapHandleRef) noexcept
Definition Procgen.cpp:1482
eve::Result< ProcgenPointSetHandleRef > differencePointsHandle(ProcgenPointSetHandleRef first, ProcgenPointSetHandleRef second)
Difference points handle.
eve::Result< ProcgenPointSetHandleRef > remapDensityHandle(ProcgenPointSetHandleRef input, float inputMin, float inputMax, float outputMin, float outputMax, bool clampOutput)
Remap density handle.
eve::Result< ProcgenPointSetHandleRef > transformPoints3DHandle(ProcgenPointSetHandleRef input, float translateX, float translateY, float translateZ, float pitchDegrees, float yawDegrees, float rollDegrees, float scaleX, float scaleY, float scaleZ)
Transform points 3 d handle.
eve::Result< ProcgenPointSetHandleRef > projectToHeightmapHandle(ProcgenPointSetHandleRef input, ProcgenHeightmapHandleRef heightmap, float originX, float originZ, float cellSize, float heightScale)
Project to heightmap handle.
eve::Result< ProcgenPointSetHandleRef > mathFloatAttributeHandle(ProcgenPointSetHandleRef input, const std::string &attribute, const std::string &outputAttribute, const std::string &operation, float operand, float defaultValue)
Math float attribute handle.
eve::Result< ProcgenPointSetHandleRef > filterFloatAttributeHandle(ProcgenPointSetHandleRef input, const std::string &name, float minValue, float maxValue, bool invert)
Filter float attribute handle.
eve::Result< ProcgenPointSetHandleRef > filterBoxHandle(ProcgenPointSetHandleRef input, float minX, float minY, float minZ, float maxX, float maxY, float maxZ, bool invert=false)
Filter box handle.
PointSet samplePolylinePoints(const PointSet &controlPoints, float spacing, uint32_t seed, float lateralJitter)
Sample polyline points.
Definition PointSet.cpp:761
PointSet transformPointSet3D(const PointSet &input, float translateX, float translateY, float translateZ, float pitchDegrees, float yawDegrees, float rollDegrees, float scaleX, float scaleY, float scaleZ)
Apply translation, pitch/yaw/roll rotation and non-uniform scale.
Definition PointSet.cpp:895
PointSet filterPointStringAttribute(const PointSet &input, const std::string &name, const std::string &value, bool invert)
Select points whose named string attribute equals a value.
PointSet unionPointSets(const PointSet &first, const PointSet &second)
Stable union by non-zero point id, with legacy position-and-seed fallback.
Definition PointSet.cpp:856
PointSet transformPointSet(const PointSet &input, float translateX, float translateY, float translateZ, float yawDegrees, float scaleX, float scaleY, float scaleZ)
Apply translation, yaw rotation and non-uniform scale to points and their transforms.
Definition PointSet.cpp:890
PointSet filterPointsByPolygon(const PointSet &input, const PointSet &polygon, bool invert)
Filter points by polygon.
Definition PointSet.cpp:642
PointSet filterPointBox(const PointSet &input, float minX, float minY, float minZ, float maxX, float maxY, float maxZ, bool invert)
Filter point box.
Definition PointSet.cpp:610
PointSet filterPointSlope(const PointSet &input, float minDegrees, float maxDegrees)
Filter point slope.
Definition PointSet.cpp:625
PointSet projectPointsToHeightmap(const PointSet &input, const Heightmap &heightmap, float originX, float originZ, float cellSize, float heightScale)
Project points to heightmap.
PointSet mathPointFloatAttribute(const PointSet &input, const std::string &attribute, const std::string &outputAttribute, const std::string &operation, float operand, float defaultValue)
Apply one scalar operation to a float metadata attribute or $ selector.
PointSet poissonDiskPoints(int width, int depth, float radius, uint32_t seed, int maxPoints)
Bridson blue-noise (Poisson disk) samples in a width x depth area (XZ, y=0).
Definition PointSet.cpp:506
PointSet filterPointsBySplineDistance(const PointSet &input, const PointSet &controlPoints, float minDistance, float maxDistance)
Filter points by spline distance.
Definition PointSet.cpp:653
EVENGINE_API_DOMAINS PointSet filterPointFloatAttribute(const PointSet &input, const std::string &name, float minValue, float maxValue, bool invert)
Select points whose named float attribute or $ selector lies in an inclusive range.
PointSet excludePointRadius(const PointSet &input, float x, float z, float radius)
Exclude point radius.
Definition PointSet.cpp:674
PointSet intersectPointSets(const PointSet &first, const PointSet &second)
Keep first-set points whose stable or legacy identity occurs in the second set.
Definition PointSet.cpp:868
eve::Result< eve::script::RuntimeHandleRef< Tag > > ownProcgenObject(eve::script::RuntimeObjectRegistry< T, Tag > &registry, eve::script::Owned< T > object)
PointSet mergePointSets(const PointSet &first, const PointSet &second)
Concatenate two attributed point collections while preserving order.
Definition PointSet.cpp:799
PointSet copyPointsToTargets(const PointSet &source, const PointSet &targets, bool inheritTargetAttributes)
Instantiate source points relative to targets in stable target-major order.
Definition PointSet.cpp:930
PointSet filterPointDensity(const PointSet &input, float minDensity, float maxDensity)
Filter point density.
Definition PointSet.cpp:601
PointSet selfPrunePoints(const PointSet &input, float radius)
Self prune points.
Definition PointSet.cpp:741
PointSet filterPointHeight(const PointSet &input, float minHeight, float maxHeight)
Filter point height.
Definition PointSet.cpp:592
PointSet densityCullPoints(const PointSet &input, uint32_t seed, float multiplier)
Deterministically keep points according to density and a root seed.
PointSet differencePointSets(const PointSet &first, const PointSet &second)
Remove first-set points whose stable or legacy identity occurs in the second set.
Definition PointSet.cpp:879
PointSet jitterPointPositions(const PointSet &input, uint32_t seed, float amountX, float amountZ)
Jitter point positions.
Definition PointSet.cpp:728
PointSet remapPointDensity(const PointSet &input, float inputMin, float inputMax, float outputMin, float outputMax, bool clampOutput)
Linearly remap point density between ranges with optional output clamping.
PointSet sampleGridPoints(int width, int depth, float spacing, uint32_t seed, float jitter)
Sample grid points.
Definition PointSet.cpp:484
Result< PointSet > excludePointsByGridMask(const PointSet &input, const Grid2D &mask, float originX, float originZ, float cellSize, int semantic, float clearance, std::size_t maximumChecks)
Remove points covered by a semantic grid mask plus optional world-space clearance.
Definition PointSet.cpp:686
One deterministic sample used by script-first procedural pipelines.
Definition PointSet.h:17
Handle plus owner-lifetime epoch for a non-ECS registry object.