summaryrefslogtreecommitdiff
path: root/demo/Node.lua
diff options
context:
space:
mode:
Diffstat (limited to 'demo/Node.lua')
-rw-r--r--demo/Node.lua7
1 files changed, 4 insertions, 3 deletions
diff --git a/demo/Node.lua b/demo/Node.lua
index 7bd1ad5..6177fc5 100644
--- a/demo/Node.lua
+++ b/demo/Node.lua
@@ -32,14 +32,15 @@ Node.prototype.updateCascade = function(self, dt)
end
end
-Node.prototype.drawCascade = function(self, camera, shader)
- if self.draw then
+Node.prototype.drawCascade = function(self, camera, shader, filter)
+ filter = filter or function(node) return true end
+ if self.draw and filter(self) then
self:draw(camera, shader)
end
-- do not draw base nodes, but recursively draw children.
for _, child in ipairs(self.children) do
- child:drawCascade(camera, shader)
+ child:drawCascade(camera, shader, filter)
end
end