载入中...
搜索中...
未找到
SplinePathBinder.cpp
浏览该文件的文档.
2#include <algorithm>
3#include <cmath>
4#include <limits>
5#include "common/SceneQuery.h"
7
8// SplinePathBinder.cpp
9namespace eve::procgen_editing {
10namespace {
11
12const EditorValue* field(const EditorValue& value, const char* key) {
13 const auto* object = value.getIf<EditorValue::Object>();
14 if (!object) return nullptr;
15 const auto found = object->find(key);
16 return found == object->end() ? nullptr : &found->second;
17}
18
19EditorValue bindingValue(const SplinePointBinding& binding) {
20 return EditorValue::Object{{"point", EditorValue(binding.point.value())},
21 {"host", EditorValue(binding.host)},
22 {"object", EditorValue(binding.object)}};
23}
24
25} // namespace
26
28 const std::string& object) const {
29 if (!query_)
30 return eve::editing::failed<SplineBindingPose>(EditorStatus::Unsupported,
31 RuleId("editor.spline.binding-provider-absent"),
32 "Scene transform provider is not available");
33 auto lookedUp = query_->getNodeIn(host, object);
34 if (!lookedUp)
35 return eve::editing::failed<SplineBindingPose>(EditorStatus::Conflict,
36 RuleId("editor.spline.binding-source-stale"),
37 "Bound scene transform is missing or stale");
38 const SceneNodeInfo info = std::move(lookedUp).value();
39 return eve::editing::applied<SplineBindingPose>({info.x, info.y, info.z});
40}
41
42SplinePathBinder::SplinePathBinder(std::string documentTarget) : documentTarget_(std::move(documentTarget)) {}
43
45 std::string object, const ISplineBindingTransformSource& source) {
46 if (document.targetId().value() != documentTarget_)
47 return eve::editing::failed<void>(EditorStatus::Rejected, RuleId("editor.spline.binding-target-mismatch"),
48 "Spline binder targets another document");
49 const auto points = document.points();
50 if (point.empty() ||
51 std::none_of(points.begin(), points.end(), [&](const auto& value) { return value.id == point; }))
52 return eve::editing::failed<void>(EditorStatus::NotFound, RuleId("editor.spline.binding-point-missing"),
53 "Bound spline point does not exist");
54 if (host.empty() || object.empty())
55 return eve::editing::failed<void>(EditorStatus::Rejected, RuleId("editor.spline.binding-identity-empty"),
56 "Spline binding requires non-empty host and object identities");
57 auto resolved = source.resolve(host, object);
58 if (!resolved.ok())
59 return eve::editing::failed<void>(resolved.code(), RuleId("editor.spline.binding-source-stale"),
60 resolved.status().describe());
61 bindings_[point] = {point, std::move(host), std::move(object)};
62 return eve::editing::applied<void>();
63}
64
66 if (!bindings_.erase(point))
67 return eve::editing::failed<void>(EditorStatus::NotFound, RuleId("editor.spline.binding-not-found"),
68 "Spline point binding was not found");
69 return eve::editing::applied<void>();
70}
71
74 if (document.targetId().value() != documentTarget_)
75 return eve::editing::failed<void>(EditorStatus::Rejected, RuleId("editor.spline.binding-target-mismatch"),
76 "Spline binder targets another document");
77 auto candidate = document;
78 const auto points = document.points();
79 for (const auto& [id, binding] : bindings_) {
80 const auto found =
81 std::find_if(points.begin(), points.end(), [&](const auto& value) { return value.id == id; });
82 if (found == points.end())
83 return eve::editing::failed<void>(EditorStatus::Conflict, RuleId("editor.spline.binding-point-stale"),
84 "Bound spline point was removed");
85 auto pose = source.resolve(binding.host, binding.object);
86 if (!pose.ok())
87 return eve::editing::failed<void>(pose.code(), RuleId("editor.spline.binding-source-stale"),
88 pose.status().describe());
89 if (!std::isfinite(pose.value().x) || !std::isfinite(pose.value().y) || !std::isfinite(pose.value().z))
90 return eve::editing::failed<void>(EditorStatus::Rejected, RuleId("editor.spline.binding-pose-invalid"),
91 "Bound transform returned non-finite coordinates");
92 auto updated = *found;
93 updated.x = pose.value().x;
94 updated.y = pose.value().y;
95 updated.z = pose.value().z;
96 auto operation = candidate.makeSetPoint(updated);
97 if (!operation.ok())
98 return eve::editing::failed<void>(operation.code(), RuleId("editor.spline.binding-operation-failed"),
99 operation.status().describe());
100 auto applied = candidate.applyDomainOperation(operation.value());
101 if (!applied.ok()) return applied;
102 }
103 return document.commitDomainState(std::make_unique<SplinePathDocument>(std::move(candidate)));
104}
105
106std::vector<SplinePointBinding> SplinePathBinder::bindings() const {
107 std::vector<SplinePointBinding> result;
108 result.reserve(bindings_.size());
109 for (const auto& [unused, binding] : bindings_) {
110 (void)unused;
111 result.push_back(binding);
112 }
113 return result;
114}
115
118 for (const auto& [unused, binding] : bindings_) {
119 (void)unused;
120 bindings.emplace_back(bindingValue(binding));
121 }
122 return EditorValue::Object{{"schema", EditorValue("eve.procgen.splineBinder")},
123 {"version", EditorValue(std::int64_t{1})},
124 {"document", EditorValue(documentTarget_)},
125 {"bindings", EditorValue(std::move(bindings))}};
126}
127
129 const auto* schemaValue = field(snapshot, "schema");
130 const auto* versionValue = field(snapshot, "version");
131 const auto* documentValue = field(snapshot, "document");
132 const auto* bindingsValue = field(snapshot, "bindings");
133 const auto* schema = schemaValue ? schemaValue->getIf<std::string>() : nullptr;
134 const auto* version = versionValue ? versionValue->getIf<std::int64_t>() : nullptr;
135 const auto* document = documentValue ? documentValue->getIf<std::string>() : nullptr;
136 const auto* values = bindingsValue ? bindingsValue->getIf<EditorValue::Array>() : nullptr;
137 if (!schema || *schema != "eve.procgen.splineBinder" || !version || *version != 1)
138 return eve::editing::failed<void>(EditorStatus::Unsupported, RuleId("editor.spline.binding-schema-unsupported"),
139 "Unsupported spline binder snapshot schema");
140 if (!document || *document != documentTarget_ || !values)
141 return eve::editing::failed<void>(EditorStatus::Rejected, RuleId("editor.spline.binding-snapshot-invalid"),
142 "Spline binder snapshot targets another document or has invalid bindings");
143 std::map<StableId, SplinePointBinding> candidate;
144 for (const auto& value : *values) {
145 const auto* pointValue = field(value, "point");
146 const auto* hostValue = field(value, "host");
147 const auto* objectValue = field(value, "object");
148 const auto* point = pointValue ? pointValue->getIf<std::string>() : nullptr;
149 const auto* host = hostValue ? hostValue->getIf<std::string>() : nullptr;
150 const auto* object = objectValue ? objectValue->getIf<std::string>() : nullptr;
151 if (!point || point->empty() || !host || host->empty() || !object || object->empty() ||
152 !candidate.emplace(StableId(*point), SplinePointBinding{StableId(*point), *host, *object}).second)
153 return eve::editing::failed<void>(EditorStatus::Rejected, RuleId("editor.spline.binding-snapshot-invalid"),
154 "Spline binder snapshot contains invalid or duplicate links");
155 }
156 bindings_ = std::move(candidate);
157 return eve::editing::applied<void>();
158}
159
160} // namespace eve::procgen_editing
161
162// SplinePathGizmo.cpp
163namespace eve::procgen_editing {
164namespace {
165
166editing::GizmoSnapshot failedSnapshot(const SplinePathDocument& document, const char* rule, std::string message) {
168 result.target = document.targetId().value();
169 result.targetRevision = document.revision();
171 DiagnosticSeverity::Error, std::move(message)));
172 return result;
173}
174
175std::array<double, 3> position(const SplinePathControlPoint& point) { return {point.x, point.y, point.z}; }
176
177void addLine(editing::GizmoSnapshot& output, std::string id, const std::array<double, 3>& from,
178 const std::array<double, 3>& to, std::array<double, 4> color, bool dashed = false) {
179 std::array<double, 3> direction{to[0] - from[0], to[1] - from[1], to[2] - from[2]};
180 const double length =
181 std::sqrt(direction[0] * direction[0] + direction[1] * direction[1] + direction[2] * direction[2]);
182 if (length <= 1e-12) return;
183 for (double& value : direction) value /= length;
184 output.primitives.push_back({std::move(id), "line", from, {}, direction, color, 0.0, length, dashed});
185}
186
187bool normalizeRay(double x, double y, double z, std::array<double, 3>& output) {
188 const double length = std::sqrt(x * x + y * y + z * z);
189 if (!std::isfinite(length) || length < 1e-9) return false;
190 output = {x / length, y / length, z / length};
191 return true;
192}
193
194} // namespace
195
197 int maximumSamples, SplineGizmoStyle style) const {
198 if (sampleCount < 2 || maximumSamples < 2 || sampleCount > maximumSamples)
199 return failedSnapshot(document, "editor.spline.gizmo-budget",
200 "Spline gizmo sample count exceeds its bounded budget");
201 const auto validColor = [](const auto& color) {
202 return std::all_of(color.begin(), color.end(),
203 [](double value) { return std::isfinite(value) && value >= 0.0 && value <= 1.0; });
204 };
205 if (!std::isfinite(style.nodeSize) || !std::isfinite(style.handleSize) || style.nodeSize <= 0.0 ||
206 style.handleSize <= 0.0 || !validColor(style.lineColor) || !validColor(style.textColor))
207 return failedSnapshot(document, "editor.spline.gizmo-style-invalid",
208 "Spline gizmo sizes must be positive and colors must be finite normalized values");
210 result.target = document.targetId().value();
211 result.targetRevision = document.revision();
212 for (const auto& point : document.points()) {
213 const auto anchor = position(point);
214 result.primitives.push_back(
215 {"spline.anchor." + point.id.value(), "sphere", anchor, {}, {}, {1.0, 0.72, 0.18, 1.0}, style.nodeSize});
216 if (style.showPointLabels) {
218 label.id = "spline.label." + point.id.value();
219 label.kind = "text";
220 label.position = anchor;
221 label.color = style.textColor;
222 label.text = point.id.value();
223 result.primitives.push_back(std::move(label));
224 }
225 if (document.settings().kind != "bezier") continue;
226 const std::array<double, 3> incoming{point.x + point.inX, point.y + point.inY, point.z + point.inZ};
227 const std::array<double, 3> outgoing{point.x + point.outX, point.y + point.outY, point.z + point.outZ};
228 addLine(result, "spline.in-line." + point.id.value(), anchor, incoming, {0.95, 0.4, 0.3, 0.9}, true);
229 addLine(result, "spline.out-line." + point.id.value(), anchor, outgoing, {0.35, 0.9, 0.45, 0.9}, true);
230 result.primitives.push_back(
231 {"spline.in." + point.id.value(), "sphere", incoming, {}, {}, {0.95, 0.4, 0.3, 1.0}, style.handleSize});
232 result.primitives.push_back(
233 {"spline.out." + point.id.value(), "sphere", outgoing, {}, {}, {0.35, 0.9, 0.45, 1.0}, style.handleSize});
234 }
235 auto path = document.compilePath();
236 if (!path.ok()) {
237 if (document.points().size() >= 2)
238 return failedSnapshot(document, "editor.spline.gizmo-incomplete", path.status().describe());
239 result.diagnostics.push_back(editing::ruleDiagnostic(
240 DiagnosticCode::PreconditionViolation, RuleId("editor.spline.gizmo-incomplete"),
241 DiagnosticSeverity::Warning, "Add at least two points to preview the spline curve"));
242 result.status = EditorStatus::Applied;
243 return result;
244 }
245 auto polyline = path.value().polylineResult(sampleCount, false);
246 if (!polyline.ok()) return failedSnapshot(document, "editor.spline.gizmo-evaluate", polyline.status().describe());
247 for (int chunk = 0; chunk < polyline.value().chunkCount(); ++chunk) {
248 auto previous = polyline.value().chunkPointResult(chunk, 0);
249 if (!previous.ok())
250 return failedSnapshot(document, "editor.spline.gizmo-evaluate", previous.status().describe());
251 for (int sample = 1; sample < polyline.value().chunkPointCount(chunk); ++sample) {
252 auto current = polyline.value().chunkPointResult(chunk, sample);
253 if (!current.ok())
254 return failedSnapshot(document, "editor.spline.gizmo-evaluate", current.status().describe());
255 addLine(result, "spline.chunk." + std::to_string(chunk) + ".segment." + std::to_string(sample - 1),
256 {previous.value().x, previous.value().y, previous.value().z},
257 {current.value().x, current.value().y, current.value().z}, style.lineColor);
258 previous = std::move(current);
259 }
260 }
261 result.status = EditorStatus::Applied;
262 return result;
263}
264
266 : document_(document), sampleCount_(sampleCount) {}
267
268Result<SplinePathDragPreview> SplinePathDragSession::previewCurrent() const {
269 if (!document_ || !dragging_)
270 return eve::editing::failed<SplinePathDragPreview>(
271 EditorStatus::Rejected, RuleId("editor.spline.drag-not-active"), "Spline drag has not begun");
272 SplinePathDocument candidate = *document_;
273 auto operation = candidate.makeSetPoint(draft_);
274 if (!operation.ok() || !candidate.applyDomainOperation(operation.value()).ok())
275 return eve::editing::failed<SplinePathDragPreview>(EditorStatus::Rejected,
276 RuleId("editor.spline.drag-preview-invalid"),
277 "Spline draft could not be previewed");
279 result.status = EditorStatus::Applied;
280 result.point = activePoint_;
281 result.handle = activeHandle_;
282 result.draft = draft_;
283 result.gizmo = SplinePathGizmoBuilder().build(candidate, sampleCount_);
284 if (result.gizmo.status != EditorStatus::Applied) result.status = result.gizmo.status;
285 return eve::editing::applied<SplinePathDragPreview>(std::move(result));
286}
287
288Result<SplinePathDragPreview> SplinePathDragSession::beginDrag(double rayOriginX, double rayOriginY, double rayOriginZ,
289 double rayDirectionX, double rayDirectionY,
290 double rayDirectionZ) {
291 cancelDrag();
292 if (!document_)
293 return eve::editing::failed<SplinePathDragPreview>(
294 EditorStatus::Rejected, RuleId("editor.spline.drag-target-required"), "Spline drag target is unavailable");
295 std::array<double, 3> direction;
296 if (!normalizeRay(rayDirectionX, rayDirectionY, rayDirectionZ, direction))
297 return eve::editing::failed<SplinePathDragPreview>(EditorStatus::Rejected,
298 RuleId("editor.spline.drag-ray-invalid"),
299 "Spline drag requires a finite non-zero pointer ray");
300 const std::array<double, 3> origin{rayOriginX, rayOriginY, rayOriginZ};
301 const auto gizmo = SplinePathGizmoBuilder().build(*document_, sampleCount_);
302 if (gizmo.status != EditorStatus::Applied)
303 return eve::editing::failed<SplinePathDragPreview>(EditorStatus::Rejected,
304 RuleId("editor.spline.drag-gizmo-invalid"),
305 "Spline gizmo is not available for picking");
306 double closest = std::numeric_limits<double>::infinity();
307 std::string pickedId;
308 for (const auto& primitive : gizmo.primitives) {
309 if (primitive.kind != "sphere" || primitive.id.rfind("spline.", 0) != 0) continue;
310 const std::array<double, 3> offset{origin[0] - primitive.position[0], origin[1] - primitive.position[1],
311 origin[2] - primitive.position[2]};
312 const double b = offset[0] * direction[0] + offset[1] * direction[1] + offset[2] * direction[2];
313 const double c =
314 offset[0] * offset[0] + offset[1] * offset[1] + offset[2] * offset[2] - primitive.radius * primitive.radius;
315 const double discriminant = b * b - c;
316 if (discriminant < 0.0) continue;
317 const double nearHit = -b - std::sqrt(discriminant);
318 const double farHit = -b + std::sqrt(discriminant);
319 const double hit = nearHit >= 0.0 ? nearHit : farHit;
320 if (hit < 0.0 || hit >= closest) continue;
321 closest = hit;
322 pickedId = primitive.id;
323 dragPlanePoint_ = primitive.position;
324 }
325 if (pickedId.empty())
326 return eve::editing::failed<SplinePathDragPreview>(
327 EditorStatus::NotFound, RuleId("editor.spline.handle-not-hit"), "Pointer ray did not hit a spline handle");
328 const auto roleEnd = pickedId.find('.', 7);
329 activeHandle_ = pickedId.substr(7, roleEnd - 7);
330 activePoint_ = StableId(pickedId.substr(roleEnd + 1));
331 const auto points = document_->points();
332 const auto found =
333 std::find_if(points.begin(), points.end(), [&](const auto& point) { return point.id == activePoint_; });
334 if (found == points.end())
335 return eve::editing::failed<SplinePathDragPreview>(
336 EditorStatus::NotFound, RuleId("editor.spline.point-not-found"), "Picked spline point no longer exists");
337 draft_ = *found;
338 dragPlaneNormal_ = direction;
339 baseRevision_ = document_->revision();
340 dragging_ = true;
341 return previewCurrent();
342}
343
344Result<SplinePathDragPreview> SplinePathDragSession::updateDrag(double rayOriginX, double rayOriginY, double rayOriginZ,
345 double rayDirectionX, double rayDirectionY,
346 double rayDirectionZ) {
347 if (!dragging_ || !document_)
348 return eve::editing::failed<SplinePathDragPreview>(
349 EditorStatus::Rejected, RuleId("editor.spline.drag-not-active"), "Spline drag has not begun");
350 if (document_->revision() != baseRevision_) {
351 cancelDrag();
352 return eve::editing::failed<SplinePathDragPreview>(EditorStatus::Conflict, RuleId("editor.spline.drag-stale"),
353 "Spline document changed while dragging");
354 }
355 std::array<double, 3> direction;
356 if (!normalizeRay(rayDirectionX, rayDirectionY, rayDirectionZ, direction))
357 return eve::editing::failed<SplinePathDragPreview>(EditorStatus::Rejected,
358 RuleId("editor.spline.drag-ray-invalid"),
359 "Spline drag requires a finite non-zero pointer ray");
360 const std::array<double, 3> origin{rayOriginX, rayOriginY, rayOriginZ};
361 const double denominator =
362 direction[0] * dragPlaneNormal_[0] + direction[1] * dragPlaneNormal_[1] + direction[2] * dragPlaneNormal_[2];
363 if (std::abs(denominator) < 1e-9)
364 return eve::editing::failed<SplinePathDragPreview>(EditorStatus::Rejected,
365 RuleId("editor.spline.drag-ray-parallel"),
366 "Pointer ray is parallel to the spline drag plane");
367 const double distance = ((dragPlanePoint_[0] - origin[0]) * dragPlaneNormal_[0] +
368 (dragPlanePoint_[1] - origin[1]) * dragPlaneNormal_[1] +
369 (dragPlanePoint_[2] - origin[2]) * dragPlaneNormal_[2]) /
370 denominator;
371 if (distance < 0.0)
372 return eve::editing::failed<SplinePathDragPreview>(EditorStatus::Rejected,
373 RuleId("editor.spline.drag-behind-camera"),
374 "Spline drag plane is behind the pointer ray origin");
375 const std::array<double, 3> world{origin[0] + direction[0] * distance, origin[1] + direction[1] * distance,
376 origin[2] + direction[2] * distance};
377 if (activeHandle_ == "anchor") {
378 draft_.x = world[0];
379 draft_.y = world[1];
380 draft_.z = world[2];
381 } else if (activeHandle_ == "in") {
382 draft_.inX = world[0] - draft_.x;
383 draft_.inY = world[1] - draft_.y;
384 draft_.inZ = world[2] - draft_.z;
385 } else {
386 draft_.outX = world[0] - draft_.x;
387 draft_.outY = world[1] - draft_.y;
388 draft_.outZ = world[2] - draft_.z;
389 }
390 return previewCurrent();
391}
392
394 if (!dragging_ || !document_)
395 return eve::editing::failed<DomainOperation>(EditorStatus::Rejected, RuleId("editor.spline.drag-not-active"),
396 "Spline drag has not begun");
397 if (document_->revision() != baseRevision_) {
398 cancelDrag();
399 return eve::editing::failed<DomainOperation>(EditorStatus::Conflict, RuleId("editor.spline.drag-stale"),
400 "Spline document changed before drag commit");
401 }
402 auto operation = document_->makeSetPoint(draft_);
403 if (operation.ok()) cancelDrag();
404 return operation;
405}
406
408 dragging_ = false;
409 activePoint_ = {};
410 activeHandle_.clear();
411}
412
413} // namespace eve::procgen_editing
double z
double y
double x
ActionParameterOperation operation
std::string output
eve::EntitySpatialPose pose
bool applied
SQObjectPtr key
Definition ECS.cpp:155
std::string message
std::int32_t second
std::int32_t c
float length
size_t offset
std::array< float, 3 > position
std::string to
std::string label
std::string from
Poco::JSON::Object::Ptr result
Snapshot snapshot
MeleePoint3 b
Definition MeleeHit.cpp:41
float distance
glm::dvec3 origin
std::shared_ptr< const OceanSprayFrame > previous
eve::action::ActionVfxBinding binding
std::array< std::uint64_t, kPixelChunkSize *kPixelChunkSize > updated
std::string path
Definition PlayHost.cpp:111
std::shared_ptr< const std::vector< glm::vec2 > > points
bool hit
std::set< std::string > values
Object::Ptr value
RoadNetwork resolved
RoadLaneDirection direction
bool found
std::string_view source
double current
Json object
UIHostHandle host
glm::vec3 point
virtual Result< SceneNodeInfo > getNodeIn(const std::string &host, const std::string &id) const =0
Look up one node in a named host.
bool ok() const noexcept
Whether this result represents a non-failure outcome.
Definition Result.h:514
Move-only operation result carrying either a value or Status.
Definition Result.h:176
UUID-backed identifier adapter for legacy textual boundaries.
Definition Identity.h:313
const std::string & value() const noexcept
Returns the exact legacy or canonical compatibility spelling.
Definition Identity.h:365
std::uint64_t revision() const override
Return the current revision.
Deterministic owning value tree shared by authoring hosts.
std::vector< Value > Array
std::map< std::string, Value > Object
const T * getIf() const
Return an immediately borrowed typed value.
Consumer-owned transform lookup contract used by spline binding.
Result< SplineBindingPose > resolve(const std::string &host, const std::string &object) const override
Resolve.
Result< void > loadSnapshot(const EditorValue &snapshot)
Atomically restore links for this binder's pinned target.
Result< void > bindResult(const SplinePathDocument &document, const StableId &point, std::string host, std::string object, const ISplineBindingTransformSource &source)
Validate and atomically install or replace one point binding.
EditorValue snapshotValue() const
Capture schema eve.procgen.splineBinder version one.
Result< void > refreshResult(SplinePathDocument &document, const ISplineBindingTransformSource &source) const
Resolve every link, then commit all point positions as one isolated document update.
Result< void > unbindResult(const StableId &point)
Remove one binding without touching its spline point.
std::vector< SplinePointBinding > bindings() const
Return deterministic bindings ordered by stable point id.
SplinePathBinder(std::string documentTarget)
Construct a binder pinned to one spline document target identity.
Owning spline authoring document with transactional operations and schema-versioned snapshots.
TargetId targetId() const override
Target id.
Result< DomainOperation > makeSetPoint(const SplinePathControlPoint &point) const override
Make set point.
Result< void > commitDomainState(std::unique_ptr< IDomainOperationTarget > candidate) override
Commits domain state.
std::vector< SplinePathControlPoint > points() const
Return points in deterministic order and stable-id tie order.
Result< void > applyDomainOperation(const DomainOperation &operation) override
Applies domain operation.
TargetDescriptor describe() const override
Describe.
Result< procgen::SplinePath > compilePath() const
Compile an owning runtime spline without retaining document references.
const SplinePathSettings & settings() const noexcept
Return current interpolation and closure settings.
Result< SplinePathDragPreview > updateDrag(double rayOriginX, double rayOriginY, double rayOriginZ, double rayDirectionX, double rayDirectionY, double rayDirectionZ)
Project a pointer ray onto the original camera-facing drag plane and update only the draft.
void cancelDrag()
Discard transient state without changing the document.
Result< DomainOperation > finishDrag()
Produce one reversible point replacement operation without applying it.
SplinePathDragSession(SplinePathDocument *document, int sampleCount=64)
Create an idle session borrowing an authoritative spline document.
Result< SplinePathDragPreview > beginDrag(double rayOriginX, double rayOriginY, double rayOriginZ, double rayDirectionX, double rayDirectionY, double rayDirectionZ)
Pick the nearest anchor or Bezier handle sphere intersected by a world ray.
Builds sampled path, anchor and Bezier handle overlay primitives.
editing::GizmoSnapshot build(const SplinePathDocument &document, int sampleCount=64, int maximumSamples=4096, SplineGizmoStyle style={}) const
Build an immutable overlay with bounded path sampling.
const Value * field(const Value &value, const char *key)
Borrow an optional object field.
StrongId< StableIdTag > StableId
Definition EditingIds.h:64
StrongId< RuleIdTag > RuleId
Definition EditingIds.h:60
Diagnostic ruleDiagnostic(eve::DiagnosticCode code, RuleId rule, DiagnosticSeverity severity, std::string message)
Build an owning common diagnostic carrying an open editing rule identity.
Serializable snapshot of one scene node (value type, no scene types).
Definition SceneQuery.h:18
Renderer-neutral wire primitive for authoring viewport overlays.
Immutable revision-tagged overlay snapshot consumed by any viewport renderer.
Renderer-neutral appearance settings for spline viewport overlays.
Immutable renderer-neutral spline drag preview.
Persistent link from one spline control point to one scene transform identity.
glm::uvec4 info
glm::vec4 color