mirror of
https://github.com/brunoherbelin/vimix.git
synced 2025-12-11 18:34:58 +01:00
Bugfix draw visitor (ensure clean start when visiting scene)
This commit is contained in:
@@ -60,11 +60,17 @@ void DrawVisitor::visit(Group &n)
|
||||
|
||||
void DrawVisitor::visit(Scene &n)
|
||||
{
|
||||
done_ = false;
|
||||
modelview_ = glm::identity<glm::mat4>();
|
||||
n.root()->accept(*this);
|
||||
}
|
||||
|
||||
void DrawVisitor::visit(Switch &n)
|
||||
{
|
||||
// no need to traverse deeper if this node was drawn already
|
||||
if (done_) return;
|
||||
|
||||
// traverse acive child
|
||||
glm::mat4 mv = modelview_;
|
||||
n.activeChild()->accept(*this);
|
||||
modelview_ = mv;
|
||||
|
||||
Reference in New Issue
Block a user