MCPcopy Create free account
hub / github.com/ElectroZybr/LatticeLab / processClick

Method processClick

App/interaction/picking/PickingSystem.cpp:26–46  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

24}
25
26void PickingSystem::processClick(glm::ivec2 screenPos, bool cumulative) {
27 AtomHit hit;
28 bool found = pickAtom(screenPos, 10.0f, hit);
29
30 if (found) {
31 // Если атом уже был выбран и зажат Ctrl — инвертируем (снимаем выделение)
32 if (cumulative && selectedAtomIds.contains(hit.id)) {
33 selectedAtomIds.erase(hit.id);
34 }
35 else {
36 // Иначе — добавляем в набор
37 selectedAtomIds.insert(hit.id);
38 }
39 }
40 else {
41 // Клик в пустоту без Ctrl — сбрасываем всё
42 if (!cumulative) {
43 clearSelection();
44 }
45 }
46}
47
48void PickingSystem::processRect(glm::ivec2 start, glm::ivec2 end, bool cumulative) {
49 if (!cumulative) {

Callers 1

onLeftPressedMethod · 0.80

Calls 1

containsMethod · 0.80

Tested by

no test coverage detected