mirror of
https://github.com/MaSzyna-EU07/maszyna.git
synced 2026-10-22 02:56:24 +02:00
feat(editor): W17 placed and checked one by one: a list of the switches without one or with one standing wrong, a click on its point in the view puts or moves that one
- the panel shows the scope and what's found first, then Place and Move for all, then each missing or wrong marker with its own button and a click flying the camera there; the spacing, tolerances, height, model and turn are under Settings - a click on a green point (no marker) or a red one (marker standing wrong) in the view puts or moves that marker alone - the check starts around the camera - one camera flight, fly_to, instead of four copies of it - self-test fouling show=1 and place=one
This commit is contained in:
@@ -675,23 +675,19 @@ void editor_mode::start_focus(scene::basic_node *node, double duration)
|
||||
double const len = glm::length(dir);
|
||||
dir = len > 1e-3 ? dir / len : glm::normalize(glm::dvec3(1.0, 0.5, 1.0));
|
||||
|
||||
// looking from there straight at the object
|
||||
fly_to(center, -dir, distance, duration);
|
||||
}
|
||||
|
||||
void editor_mode::fly_to(glm::dvec3 const &Target, glm::dvec3 const &Look, double const Distance, double const Duration)
|
||||
{
|
||||
m_focus_start_pos = Camera.Pos;
|
||||
m_focus_start_angle = Camera.Angle;
|
||||
m_focus_target_pos = center + dir * distance;
|
||||
|
||||
// target orientation looks from the target position straight at the object
|
||||
glm::dvec3 look = center - m_focus_target_pos;
|
||||
double const looklen = glm::length(look);
|
||||
if (looklen > 1e-6)
|
||||
look /= looklen;
|
||||
m_focus_target_angle = glm::vec3(
|
||||
static_cast<float>(std::asin(glm::clamp(look.y, -1.0, 1.0))), // pitch
|
||||
static_cast<float>(std::atan2(-look.x, -look.z)), // yaw
|
||||
0.0f); // roll
|
||||
|
||||
m_focus_target_pos = Target - Look * Distance;
|
||||
m_focus_target_angle = glm::vec3(static_cast<float>(std::asin(std::clamp(Look.y, -1.0, 1.0))), static_cast<float>(std::atan2(-Look.x, -Look.z)), 0.0f);
|
||||
m_focus_active = true;
|
||||
m_focus_time = 0.0;
|
||||
m_focus_duration = duration;
|
||||
m_focus_duration = Duration;
|
||||
}
|
||||
|
||||
void editor_mode::snap_to_ground(scene::basic_node *node, bool const Alone, bool const Joined)
|
||||
|
||||
Reference in New Issue
Block a user