Lagrange
Loading...
Searching...
No Matches
update_gizmo.h
1
/*
2
* Copyright 2021 Adobe. All rights reserved.
3
* This file is licensed to you under the Apache License, Version 2.0 (the "License");
4
* you may not use this file except in compliance with the License. You may obtain a copy
5
* of the License at http://www.apache.org/licenses/LICENSE-2.0
6
*
7
* Unless required by applicable law or agreed to in writing, software distributed under
8
* the License is distributed on an "AS IS" BASIS, WITHOUT WARRANTIES OR REPRESENTATIONS
9
* OF ANY KIND, either express or implied. See the License for the specific language
10
* governing permissions and limitations under the License.
11
*/
12
#pragma once
13
14
#include <lagrange/ui/Entity.h>
15
#include <lagrange/ui/api.h>
16
#include <lagrange/ui/components/Transform.h>
17
#include <lagrange/ui/types/Camera.h>
18
19
20
namespace
lagrange
{
21
namespace
ui
{
22
23
enum class
GizmoMode { SELECT, TRANSLATE, ROTATE, SCALE, count };
24
26
struct
GizmoContext
27
{
28
bool
active =
false
;
29
Eigen::Affine3f current_transform = Eigen::Affine3f::Identity();
30
Eigen::Affine3f transform_start = Eigen::Affine3f::Identity();
31
};
32
35
struct
GizmoObjectTransform
36
{
38
ui::Transform
initial_transform
;
39
42
Eigen::Affine3f
parent_inverse
;
43
};
44
45
46
LA_UI_API
bool
gizmo_system_is_using();
47
LA_UI_API
bool
gizmo_system_is_over();
48
LA_UI_API
void
gizmo_system_set_draw_list();
49
50
LA_UI_API
void
gizmo_system(
51
Registry& registry,
52
const
Camera
& camera,
53
const
Eigen::Vector2f& canvas_pos,
54
GizmoMode mode = GizmoMode::SELECT);
55
56
57
}
// namespace ui
58
}
// namespace lagrange
lagrange::ui::Camera
Camera class.
Definition
Camera.h:38
lagrange::ui
Lagrange UI Viewer and mini 3D engine.
Definition
AcceleratedPicking.h:23
lagrange
Main namespace for Lagrange.
lagrange::ui::GizmoContext
Gizmo system state (context variable)
Definition
update_gizmo.h:27
lagrange::ui::GizmoObjectTransform
GizmoObjectTransform component is attached to every entity being transformed by the gizmo system.
Definition
update_gizmo.h:36
lagrange::ui::GizmoObjectTransform::initial_transform
ui::Transform initial_transform
Transform of the object at the start of gizmo interaction.
Definition
update_gizmo.h:38
lagrange::ui::GizmoObjectTransform::parent_inverse
Eigen::Affine3f parent_inverse
Cached parent inverse Computed as (global * local.inverse()).inverse()
Definition
update_gizmo.h:42
lagrange::ui::Transform
Affine transformation.
Definition
Transform.h:23
lagrange
ui
systems
update_gizmo.h
Generated on Tue Nov 18 2025 for Lagrange by
1.13.2