Creation and minimal integration of Displays View

This commit is contained in:
Bruno Herbelin
2022-12-26 15:46:37 +01:00
parent 189e7b8bc9
commit fb6a95078d
15 changed files with 859 additions and 32 deletions

View File

@@ -34,10 +34,8 @@
#include "PickingVisitor.h"
#include "Decorations.h"
#include "Mixer.h"
#include "UserInterfaceManager.h"
#include "BoundingBoxVisitor.h"
#include "ActionManager.h"
#include "Log.h"
#include "View.h"
@@ -201,14 +199,14 @@ void View::recenter()
// if the updated (translated) view does not contains the entire scene
// we shall scale the view to fit the scene
if ( !updated_view_box.contains(scene_box)) {
if (!updated_view_box.contains(scene_box)) {
glm::vec3 view_extend = updated_view_box.max() - updated_view_box.min();
updated_view_box.extend(scene_box);
glm::vec3 scene_extend = scene_box.max() - scene_box.min();
glm::vec3 scale = view_extend / scene_extend ;
float z = scene.root()->scale_.x;
z = CLAMP( z * MIN(scale.x, scale.y), MIXING_MIN_SCALE, MIXING_MAX_SCALE);
z = CLAMP( z * MIN(scale.x, scale.y), MIN_SCALE, MAX_SCALE);
scene.root()->scale_.x = z;
scene.root()->scale_.y = z;