Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Sign in / Register
Toggle navigation
Menu
Open sidebar
Courses
Scotty3D
Commits
f6d60be2
Unverified
Commit
f6d60be2
authored
Apr 26, 2021
by
svsalem
Committed by
GitHub
Apr 26, 2021
Browse files
rotation yeeted
parent
ceb34dcc
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/gui/widgets.cpp
View file @
f6d60be2
...
@@ -181,15 +181,16 @@ Pose Widgets::apply_action(const Pose& pose) {
...
@@ -181,15 +181,16 @@ Pose Widgets::apply_action(const Pose& pose) {
}
break
;
}
break
;
case
Widget_Type
::
scale
:
{
case
Widget_Type
::
scale
:
{
if
(
univ_scl
)
{
if
(
univ_scl
)
{
result
.
scale
=
drag_end
;
result
.
scale
=
drag_end
*
pose
.
scale
;
}
else
{
}
else
{
result
.
scale
=
Vec3
{
1.0
f
};
result
.
scale
=
Vec3
{
1.0
f
};
result
.
scale
[(
int
)
axis
]
=
drag_end
[(
int
)
axis
];
result
.
scale
[(
int
)
axis
]
=
drag_end
[(
int
)
axis
];
Mat4
rot
=
pose
.
rotation_mat
();
Mat4
trans
=
Mat4
::
transpose
(
rot
)
*
Mat4
::
scale
(
result
.
scale
)
*
rot
*
Mat4
::
scale
(
pose
.
scale
);
result
.
scale
=
Vec3
(
trans
[
0
][
0
],
trans
[
1
][
1
],
trans
[
2
][
2
]);
}
}
Mat4
rot
=
pose
.
rotation_mat
();
Mat4
trans
=
Mat4
::
transpose
(
rot
)
*
Mat4
::
scale
(
result
.
scale
)
*
rot
*
Mat4
::
scale
(
pose
.
scale
);
result
.
scale
=
Vec3
(
trans
[
0
][
0
],
trans
[
1
][
1
],
trans
[
2
][
2
]);
}
break
;
}
break
;
case
Widget_Type
::
bevel
:
{
case
Widget_Type
::
bevel
:
{
Vec2
off
=
bevel_start
-
bevel_end
;
Vec2
off
=
bevel_start
-
bevel_end
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment