Unverified Commit f6d60be2 authored by svsalem's avatar svsalem Committed by GitHub
Browse files

rotation yeeted

parent ceb34dcc
...@@ -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.0f}; result.scale = Vec3{1.0f};
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;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment