Implementation of vertical crop (2 axis projection manipulation in frame

buffer). Cleanup of UI for appearance view.
This commit is contained in:
brunoherbelin
2020-11-26 20:30:37 +01:00
parent b6af17f283
commit 20f1320e2d
15 changed files with 575 additions and 162 deletions

View File

@@ -170,6 +170,23 @@ void PickingVisitor::visit(Handles &n)
}
void PickingVisitor::visit(Symbol& n)
{
// discard if not visible or if not exactly one point given for picking
if ((!n.visible_ && !force_) || points_.size() != 1)
return;
// apply inverse transform to the point of interest
glm::vec4 P = glm::inverse(modelview_) * glm::vec4( points_[0], 1.f );
// test bounding box for picking from a single point
if ( n.bbox().contains( glm::vec3(P)) ) {
// add this to the nodes picked
nodes_.push_back( std::pair(&n, glm::vec2(P)) );
}
}
void PickingVisitor::visit(Scene &n)
{
n.root()->accept(*this);