Skip to content

Commit eec433a

Browse files
committed
update demo to new picking style
1 parent c62b6d5 commit eec433a

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

examples/demo-app/demo_app.cpp

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -808,7 +808,7 @@ void callback() {
808808

809809
glm::vec3 worldRay = polyscope::view::screenCoordsToWorldRay(screenCoords);
810810
glm::vec3 worldPos = polyscope::view::screenCoordsToWorldPosition(screenCoords);
811-
std::pair<polyscope::Structure*, size_t> pickPair = polyscope::pick::pickAtScreenCoords(screenCoords);
811+
polyscope::PickResult pickResult = polyscope::queryPickAtScreenCoords(screenCoords);
812812

813813
std::cout << "Polyscope scene test click " << std::endl;
814814
std::cout << " io.MousePos.x: " << io.MousePos.x << " io.MousePos.y: " << io.MousePos.y << std::endl;
@@ -818,11 +818,12 @@ void callback() {
818818
polyscope::operator<<(std::cout, worldRay) << std::endl;
819819
std::cout << " worldPos: ";
820820
polyscope::operator<<(std::cout, worldPos) << std::endl;
821-
if (pickPair.first == nullptr) {
821+
if (pickResult.isHit) {
822+
std::cout << " structure: " << pickResult.structureType << " " << pickResult.structureName
823+
<< " local ind: " << pickResult.localIndex << std::endl;
824+
} else {
822825
std::cout << " structure: "
823826
<< "none" << std::endl;
824-
} else {
825-
std::cout << " structure: " << pickPair.first << " element id: " << pickPair.second << std::endl;
826827
}
827828

828829
// Construct point at click location

0 commit comments

Comments
 (0)