| 160 | } |
| 161 | |
| 162 | void Node::UpdateWorldBound() |
| 163 | { |
| 164 | if (!worldBoundIsCurrent) |
| 165 | { |
| 166 | // Start with an invalid bound. |
| 167 | worldBound.SetCenter({ 0.0f, 0.0f, 0.0f }); |
| 168 | worldBound.SetRadius(0.0f); |
| 169 | |
| 170 | for (auto& child : mChild) |
| 171 | { |
| 172 | if (child) |
| 173 | { |
| 174 | // GrowToContain ignores invalid child bounds. If the world |
| 175 | // bound is invalid and a child bound is valid, the child |
| 176 | // bound is copied to the world bound. If the world bound and |
| 177 | // child bound are valid, the smallest bound containing both |
| 178 | // bounds is assigned to the world bound. |
| 179 | worldBound.GrowToContain(child->worldBound); |
| 180 | } |
| 181 | } |
| 182 | } |
| 183 | } |
| 184 | |
| 185 | void Node::GetVisibleSet(Culler& culler, |
| 186 | std::shared_ptr<Camera> const& camera, bool noCull) |