Skip to content

Commit

Permalink
Work around an issue with dynamic_casts failing when downcasting to t…
Browse files Browse the repository at this point in the history
…he intermediate Base class scene::Node, originating from code located in a static library.
  • Loading branch information
codereader committed Feb 19, 2017
1 parent 3a55493 commit f550887
Show file tree
Hide file tree
Showing 3 changed files with 6 additions and 3 deletions.
3 changes: 3 additions & 0 deletions include/inode.h
Expand Up @@ -241,6 +241,9 @@ class INode :
// not by the UndoSystem itself, at least not yet.
virtual void onPostUndo() {}
virtual void onPostRedo() {}

// Called during recursive transform changed, but only by INodes themselves
virtual void transformChangedLocal() = 0;
};

} // namespace scene
4 changes: 2 additions & 2 deletions libs/scene/Node.cpp
Expand Up @@ -459,9 +459,9 @@ void Node::transformChanged()
transformChangedLocal();

// Next, traverse the children and notify them
_children.foreachNode([] (const scene::INodePtr& child)->bool
_children.foreachNode([this] (const scene::INodePtr& child)->bool
{
std::dynamic_pointer_cast<Node>(child)->transformChangedLocal();
child->transformChangedLocal();
return true;
});

Expand Down
2 changes: 1 addition & 1 deletion libs/scene/Node.h
Expand Up @@ -148,7 +148,7 @@ class Node :

const Matrix4& localToWorld() const;

void transformChangedLocal();
void transformChangedLocal() override;

void transformChanged();

Expand Down

0 comments on commit f550887

Please sign in to comment.