mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Bugfix: forced DrawVisitor was not forcing actual draw()
This commit is contained in:
@@ -25,6 +25,11 @@ void DrawVisitor::loop(int num, glm::mat4 transform)
|
|||||||
|
|
||||||
void DrawVisitor::visit(Node &n)
|
void DrawVisitor::visit(Node &n)
|
||||||
{
|
{
|
||||||
|
// force visible status if required
|
||||||
|
bool v = n.visible_;
|
||||||
|
if (force_)
|
||||||
|
n.visible_ = true;
|
||||||
|
|
||||||
// draw the target
|
// draw the target
|
||||||
if ( target_ && n.id() == target_->id()) {
|
if ( target_ && n.id() == target_->id()) {
|
||||||
|
|
||||||
@@ -37,6 +42,9 @@ void DrawVisitor::visit(Node &n)
|
|||||||
done_ = true;
|
done_ = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// restore visibility
|
||||||
|
n.visible_ = v;
|
||||||
|
|
||||||
if (done_) return;
|
if (done_) return;
|
||||||
|
|
||||||
// update transform
|
// update transform
|
||||||
@@ -72,11 +80,11 @@ void DrawVisitor::visit(Switch &n)
|
|||||||
|
|
||||||
// traverse acive child
|
// traverse acive child
|
||||||
glm::mat4 mv = modelview_;
|
glm::mat4 mv = modelview_;
|
||||||
n.activeChild()->accept(*this);
|
if ( n.activeChild()->visible_ || force_)
|
||||||
|
n.activeChild()->accept(*this);
|
||||||
modelview_ = mv;
|
modelview_ = mv;
|
||||||
}
|
}
|
||||||
|
|
||||||
void DrawVisitor::visit(Primitive &n)
|
void DrawVisitor::visit(Primitive &n)
|
||||||
{
|
{
|
||||||
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user