载入中...
搜索中...
未找到
MeshVertexAxisGizmo.cpp
浏览该文件的文档.
10editing::GizmoSnapshot MeshVertexAxisGizmoBuilder::build(const procgen::MeshDeformationSession& session,
24 {"mesh.axis.x", "arrow", position, {}, {1.0, 0.0, 0.0}, {1.0, 0.16, 0.12, 1.0}, 0.0, axisLength});
26 {"mesh.axis.y", "arrow", position, {}, {0.0, 1.0, 0.0}, {0.18, 1.0, 0.28, 1.0}, 0.0, axisLength});
28 {"mesh.axis.z", "arrow", position, {}, {0.0, 0.0, 1.0}, {0.18, 0.48, 1.0, 1.0}, 0.0, axisLength});
33Result<std::string> MeshVertexAxisGizmoBuilder::pickAxisResult(const editing::GizmoSnapshot& snapshot, double originX,
36 const double rayLength = std::sqrt(directionX * directionX + directionY * directionY + directionZ * directionZ);
41 const std::array<double, 3> ray{directionX / rayLength, directionY / rayLength, directionZ / rayLength};
72 return Result<std::string>::failure(Diagnostic::error(DiagnosticCode::NotFound, "ray did not hit an axis",
static Diagnostic error(DiagnosticCode code, std::string message, std::string path={}, DiagnosticDetails details={}, std::string source={})
Construct an error diagnostic with the standard error severity.
Definition Diagnostic.h:125
static Result failure(Status status)
Construct a failed result from a structured status.
Definition Result.h:175
Stateful CPU sculpting session with explicit bake, restore, and undo semantics.
Definition MeshDeformationSession.h:25
editing::GizmoSnapshot build(const procgen::MeshDeformationSession &session, double axisLength=1.0) const
Build three pickable axis arrows at the current selection center.
Definition MeshVertexAxisGizmo.cpp:10
Result< std::string > pickAxisResult(const editing::GizmoSnapshot &snapshot, double originX, double originY, double originZ, double directionX, double directionY, double directionZ) const
Pick x, y, or z arrow using a normalized or non-normalized world ray.
Definition MeshVertexAxisGizmo.cpp:33
Definition HeightmapBrush.h:9
@ InvalidArgument
@ NotFound
@ PreconditionViolation
Immutable revision-tagged overlay snapshot consumed by any viewport renderer.
Definition EditingGizmo.h:27
std::vector< GizmoPrimitive > primitives
Definition EditingGizmo.h:31
std::vector< Diagnostic > diagnostics
Definition EditingGizmo.h:32