MCPcopy Create free account
hub / github.com/WayfireWM/wayfire / motion_3d

Method motion_3d

plugins/single_plugins/wrot.cpp:143–162  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

141 }
142
143 void motion_3d(int x, int y)
144 {
145 if ((x == last_position.x) && (y == last_position.y))
146 {
147 return;
148 }
149
150 auto tr = wf::ensure_named_transformer<wf::scene::view_3d_transformer_t>(
151 current_view, wf::TRANSFORMER_3D, transformer_3d, current_view);
152
153 current_view->get_transformed_node()->begin_transform_update();
154 float dx = x - last_position.x;
155 float dy = y - last_position.y;
156 float ascale = glm::radians(sensitivity / 60.0f);
157 float dir = invert ? -1.f : 1.f;
158 tr->rotation = glm::rotate<float>(tr->rotation, vlen(dx, dy) * ascale,
159 {dir *dy, dir * dx, 0});
160 current_view->get_transformed_node()->end_transform_update();
161 last_position = {(double)x, (double)y};
162 }
163
164 wf::plugin_activation_data_t grab_interface = {
165 .name = "wrot",

Callers

nothing calls this directly

Calls 3

vlenFunction · 0.85
end_transform_updateMethod · 0.80

Tested by

no test coverage detected