Skip to content

Commit 76c8c27

Browse files
committed
Updates chapter25/chapter25.md
Auto commit by GitBook Editor
1 parent 19c04a5 commit 76c8c27

File tree

1 file changed

+8
-3
lines changed

1 file changed

+8
-3
lines changed

chapter25/chapter25.md

Lines changed: 8 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -129,9 +129,14 @@ We have added a new attribute, insideFrustum, to the `GameItem`class, to track t
129129

130130
The last method, is just a utility one, that accepts the map of meshes and filters all the `GameItem`instances contained in it.
131131

132-
| public void filter\(Map<? extends Mesh, List<GameItem>> mapMesh\) { for \(Map.Entry<? extends Mesh, List<GameItem>> entry : mapMesh.entrySet\(\)\) { List<GameItem> gameItems = entry.getValue\(\); filter\(gameItems, entry.getKey\(\).getBoundingRadius\(\)\); } } |
133-
| :--- |
134-
132+
```
133+
public void filter(Map<? extends Mesh, List<GameItem>> mapMesh) {
134+
for (Map.Entry<? extends Mesh, List<GameItem>> entry : mapMesh.entrySet()) {
135+
List<GameItem> gameItems = entry.getValue();
136+
filter(gameItems, entry.getKey().getBoundingRadius());
137+
}
138+
}
139+
```
135140

136141
And that’s it. We can use that class inside the rendering process. We just need to update the frustum planes, calculate which GameItems are visible and filter them out when drawing instanced and non instanced meshes.
137142

0 commit comments

Comments
 (0)