void visit(const scene::INodePtr& node) const { ASSERT_MESSAGE(_count <= _max, "Invalid _count in CollectSelectedBrushesBounds"); // stop if the array is already full if (_count == _max) { return; } if (Node_isSelected(node) && Node_isBrush(node)) { _bounds[_count] = node->worldAABB(); ++_count; } }
bool pre(const scene::INodePtr& node) { if (!node->visible()) return false; // don't traverse hidden nodes if (Node_isBrush(node)) // this node is a floor { const AABB& aabb = node->worldAABB(); float floorHeight = aabb.origin.z() + aabb.extents.z(); if (floorHeight > _current && floorHeight < _bestUp) { _bestUp = floorHeight; } if (floorHeight < _current && floorHeight > _bestDown) { _bestDown = floorHeight; } return false; } return true; }