17
0
mirror of https://github.com/MaSzyna-EU07/maszyna.git synced 2026-11-04 16:05:51 +01:00

feat(editor): track gizmo turns, lengthens and edits the control vectors, joined tracks keep the tangent

W turns the track (about its middle or the selected end) and a selection of tracks, the joined tracks follow.
E lengthens the track at its free end: a straight stays straight, an arc keeps its radius, cant and grade.
The gizmo on a control point moves, turns or lengthens the vector; the control point of the track joined
there turns with it, at a switch the vector only slides along the switch. Straight neighbours dragged along
keep their tangents and become straight again when nothing bent them.
This commit is contained in:
maj00r
2026-10-11 12:59:55 +02:00
parent 2beae15390
commit 89678ead3e
8 changed files with 782 additions and 99 deletions

View File

@@ -130,11 +130,11 @@ struct gizmo_frame
projection = editor_mode::projection_matrix(io.DisplaySize.y > 0.0f ? io.DisplaySize.x / io.DisplaySize.y : 1.0f);
}
// moves the gizmo, placed at the point given in world space, with snapping to the step when ctrl is held
bool manipulate(ImGuizmo::OPERATION const Operation, glm::mat4 &Gizmo, float const Snap, glm::mat4 *Delta = nullptr) const
bool manipulate(ImGuizmo::OPERATION const Operation, glm::mat4 &Gizmo, float const Snap, glm::mat4 *Delta = nullptr, ImGuizmo::MODE const Mode = ImGuizmo::WORLD) const
{
glm::vec3 snapvalue(Snap);
float const *snap = Global.ctrlState && Snap > 0.0f ? &snapvalue.x : nullptr;
drawn = ImGui::GetFrameCount();
return ImGuizmo::Manipulate(&view[0][0], &projection[0][0], Operation, ImGuizmo::WORLD, &Gizmo[0][0], Delta != nullptr ? &(*Delta)[0][0] : nullptr, snap);
return ImGuizmo::Manipulate(&view[0][0], &projection[0][0], Operation, Mode, &Gizmo[0][0], Delta != nullptr ? &(*Delta)[0][0] : nullptr, snap);
}
};