You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: chapter25/chapter25.md
+37-1Lines changed: 37 additions & 1 deletion
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -150,7 +150,43 @@ You can play with activating and deactivating the filtering and can check the in
150
150
151
151
# Optimizations - Frustum Culling \(II\)
152
152
153
-
Once the basis of frustum culling has been explained, we can get advatange of more refined methods that the [JOML](https://github.com/JOML-CI/JOML "JOML")library provides. In particular, it provdies a class named `FrustumIntersection`which extracts the planes of the veiw frustum in a more efficient way as described in this [paper](http://gamedevs.org/uploads/fast-extraction-viewing-frustum-planes-from-world-view-projection-matrix.pdf "paper").
153
+
Once the basis of frustum culling has been explained, we can get advatange of more refined methods that the [JOML](https://github.com/JOML-CI/JOML "JOML")library provides. In particular, it provdies a class named `FrustumIntersection`which extracts the planes of the veiw frustum in a more efficient way as described in this [paper](http://gamedevs.org/uploads/fast-extraction-viewing-frustum-planes-from-world-view-projection-matrix.pdf "paper"). Besides that, this class also provides methods for testing bounding boxes, points and spheres.
154
154
155
+
So, let's change the `FrustumCullingFilter` class. The attributes and constructor are simplified like this:
155
156
157
+
```
158
+
publicclassFrustumCullingFilter {
159
+
160
+
privatefinalMatrix4f prjViewMatrix;
161
+
162
+
privateFrustumIntersection frustumInt;
163
+
164
+
publicFrustumCullingFilter() {
165
+
prjViewMatrix =newMatrix4f();
166
+
frustumInt =newFrustumIntersection();
167
+
}
168
+
```
169
+
170
+
The updateFrustum method just delegates the plane extraction to the `FrustumIntersection`instance.
0 commit comments