Package com.jme3.shadow
Class ShadowUtil.OccludersExtractor
java.lang.Object
com.jme3.shadow.ShadowUtil.OccludersExtractor
- Enclosing class:
- ShadowUtil
OccludersExtractor is a helper class to collect splitOccluders from scene recursively.
It utilizes the scene hierarchy, instead of making the huge flat geometries list first.
Instead of adding all geometries from scene to the RenderQueue.shadowCast and checking
all of them one by one against camera frustum the whole Node is checked first
to hopefully avoid the check on its children.
-
Field Summary
-
Constructor Summary
ConstructorDescriptionOccludersExtractor
(Matrix4f vpm, int cc, BoundingBox sBB, BoundingBox cBB, GeometryList sOCC, TempVars v) -
Method Summary
Modifier and TypeMethodDescriptionint
addOccluders
(Spatial scene) Check the rootScene against camera frustum and if intersects process it recursively.
-
Field Details
-
casterCount
-
-
Constructor Details
-
OccludersExtractor
public OccludersExtractor() -
OccludersExtractor
public OccludersExtractor(Matrix4f vpm, int cc, BoundingBox sBB, BoundingBox cBB, GeometryList sOCC, TempVars v)
-
-
Method Details
-
addOccluders
Check the rootScene against camera frustum and if intersects process it recursively. The global OccludersExtractor variables need to be initialized first. Variables are updated and used inShadowUtil.updateShadowCamera(com.jme3.renderer.Camera, com.jme3.math.Vector3f[])
at last.- Parameters:
scene
- the root of the scene to check (may be null)- Returns:
- the number of shadow casters found
-