Repository navigation
Conversation
ofNode gains a monotonic transform version so external caches (frustum
culling, LOD, octree rebuilds, shadow passes) can tell when a node's
matrices have been invalidated without recomputing them:
- getTransformVersion() -- bumps on any local change
- getGlobalTransformVersion() -- walks the parent chain and combines
The counter is bumped in createMatrix() (the single chokepoint for local
transform updates), in setParent / clearParent, in the existing
onParent*Changed listeners (so a direct parent change is observable), and
in copy / move / assignment.
ofCamera gains cached frustum planes extracted from its view-projection
matrix (Gribb-Hartmann), lazily rebuilt only when inputs change:
- getFrustumPlanes(viewport) -- six normalised inward-facing planes:
left, right, bottom, top, near, far
- getFrustumPlanes() -- uses getViewport()
- getFrustumVersion() -- cheap probe for change detection
(params + global transform version)
Projection setters (setFov, setNearClip, setFarClip, setLensOffset,
setForceAspectRatio, setVFlip, enableOrtho, disableOrtho, setupPerspective,
and the lazy near/far fill in calcClipPlanes) bump an internal params
version; any node-transform change is picked up via getGlobalTransformVersion().
The cache keyed on (paramsVersion, globalTransformVersion, viewport)
rebuilds when any of those three change.
Addresses the common culling-system pattern of recomputing frustum planes
and per-node world AABBs every frame regardless of whether anything moved;
see the ofxEnTT CullingSystem addon.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds a monotonic transform version to
ofNodeand cached frustum planes toofCameraso external consumers (culling, LOD, octree, shadows) can skip work when nothing moved.Six inward-facing unit-normal planes (L, R, B, T, N, F), extracted from the view-projection matrix and cached keyed on
(paramsVersion, globalTransformVersion, viewport). Pure additions.