public class ShadowUtil
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
ShadowUtil.OccludersExtractor
OccludersExtractor is a helper class to collect splitOccluders from scene recursively.
|
Constructor and Description |
---|
ShadowUtil() |
Modifier and Type | Method and Description |
---|---|
static BoundingBox |
computeBoundForPoints(Vector3f[] pts,
Matrix4f mat)
Compute bounds from an array of points
|
static BoundingBox |
computeBoundForPoints(Vector3f[] pts,
Transform transform)
Compute bounds from an array of points
|
static BoundingBox |
computeUnionBound(GeometryList list,
Matrix4f mat)
Compute bounds of a geomList
|
static BoundingBox |
computeUnionBound(GeometryList list,
Transform transform)
Compute bounds of a geomList
|
static BoundingBox |
computeUnionBound(java.util.List<BoundingVolume> bv)
Computes the bounds of multiple bounding volumes
|
static void |
getGeometriesInCamFrustum(GeometryList inputGeometryList,
Camera camera,
GeometryList outputGeometryList)
Populates the outputGeometryList with the geometry of the
inputGeometryList that are in the frustum of the given camera
|
static void |
getGeometriesInCamFrustum(Spatial rootScene,
Camera camera,
RenderQueue.ShadowMode mode,
GeometryList outputGeometryList)
Populates the outputGeometryList with the rootScene children geometries
that are in the frustum of the given camera
|
static void |
getGeometriesInLightRadius(GeometryList inputGeometryList,
Camera[] cameras,
GeometryList outputGeometryList)
Populates the outputGeometryList with the geometry of the
inputGeometryList that are in the radius of a light.
|
static void |
getLitGeometriesInViewPort(Spatial rootScene,
Camera vpCamera,
Camera[] cameras,
RenderQueue.ShadowMode mode,
GeometryList outputGeometryList)
Populates the outputGeometryList with the geometries of the children
of OccludersExtractor.rootScene node that are both in the frustum of the given vpCamera and some camera inside cameras array.
|
static void |
updateFrustumPoints(Camera viewCam,
float nearOverride,
float farOverride,
float scale,
Vector3f[] points)
Updates the points array to contain the frustum corners of the given
camera.
|
static void |
updateFrustumPoints2(Camera viewCam,
Vector3f[] points)
Updates a points arrays with the frustum corners of the provided camera.
|
static void |
updateShadowCamera(Camera shadowCam,
Vector3f[] points)
Updates the shadow camera to properly contain the given points (which
contain the eye camera frustum corners)
|
static void |
updateShadowCamera(ViewPort viewPort,
GeometryList receivers,
Camera shadowCam,
Vector3f[] points,
GeometryList splitOccluders,
float shadowMapSize)
Updates the shadow camera to properly contain the given points (which
contain the eye camera frustum corners) and the shadow occluder objects
collected through the traverse of the scene hierarchy
|
public static void updateFrustumPoints2(Camera viewCam, Vector3f[] points)
viewCam
- points
- public static void updateFrustumPoints(Camera viewCam, float nearOverride, float farOverride, float scale, Vector3f[] points)
viewCam
- nearOverride
- farOverride
- public static BoundingBox computeUnionBound(GeometryList list, Transform transform)
list
- transform
- public static BoundingBox computeUnionBound(GeometryList list, Matrix4f mat)
list
- mat
- public static BoundingBox computeUnionBound(java.util.List<BoundingVolume> bv)
bv
- public static BoundingBox computeBoundForPoints(Vector3f[] pts, Transform transform)
pts
- transform
- public static BoundingBox computeBoundForPoints(Vector3f[] pts, Matrix4f mat)
pts
- mat
- public static void updateShadowCamera(Camera shadowCam, Vector3f[] points)
shadowCam
- points
- public static void updateShadowCamera(ViewPort viewPort, GeometryList receivers, Camera shadowCam, Vector3f[] points, GeometryList splitOccluders, float shadowMapSize)
public static void getGeometriesInCamFrustum(GeometryList inputGeometryList, Camera camera, GeometryList outputGeometryList)
inputGeometryList
- The list containing all geometries to check
against the camera frustumcamera
- the camera to check geometries againstoutputGeometryList
- the list of all geometries that are in the
camera frustumpublic static void getGeometriesInCamFrustum(Spatial rootScene, Camera camera, RenderQueue.ShadowMode mode, GeometryList outputGeometryList)
rootScene
- the rootNode of the scene to traversecamera
- the camera to check geometries againstoutputGeometryList
- the list of all geometries that are in the
camera frustumpublic static void getGeometriesInLightRadius(GeometryList inputGeometryList, Camera[] cameras, GeometryList outputGeometryList)
inputGeometryList
- The list containing all geometries to check
against the camera frustumcameras
- the camera array to check geometries againstoutputGeometryList
- the list of all geometries that are in the
camera frustumpublic static void getLitGeometriesInViewPort(Spatial rootScene, Camera vpCamera, Camera[] cameras, RenderQueue.ShadowMode mode, GeometryList outputGeometryList)
rootScene
- vpCamera
- the viewPort cameracameras
- the camera array to check geometries against, representing the light viewspaceoutputGeometryList
- the output list of all geometries that are in the camera frustum