com.jme3.shadow
Class ShadowUtil

java.lang.Object
  extended by com.jme3.shadow.ShadowUtil

public class ShadowUtil
extends java.lang.Object

Includes various useful shadow mapping functions.

See Also:
for more info.

Constructor Summary
ShadowUtil()
           
 
Method Summary
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 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(GeometryList occluders, GeometryList receivers, Camera shadowCam, Vector3f[] points)
          Updates the shadow camera to properly contain the given points (which contain the eye camera frustum corners) and the shadow occluder objects.
static void updateShadowCamera(GeometryList occluders, GeometryList receivers, Camera shadowCam, Vector3f[] points, GeometryList splitOccluders)
          Updates the shadow camera to properly contain the given points (which contain the eye camera frustum corners) and the shadow occluder objects.
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Constructor Detail

ShadowUtil

public ShadowUtil()
Method Detail

updateFrustumPoints2

public static void updateFrustumPoints2(Camera viewCam,
                                        Vector3f[] points)
Updates a points arrays with the frustum corners of the provided camera.

Parameters:
viewCam -
points -

updateFrustumPoints

public 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. The nearOverride and farOverride variables can be used to override the camera's near/far values with own values. TODO: Reduce creation of new vectors

Parameters:
viewCam -
nearOverride -
farOverride -

computeUnionBound

public static BoundingBox computeUnionBound(GeometryList list,
                                            Transform transform)
Compute bounds of a geomList

Parameters:
list -
transform -
Returns:

computeUnionBound

public static BoundingBox computeUnionBound(GeometryList list,
                                            Matrix4f mat)
Compute bounds of a geomList

Parameters:
list -
mat -
Returns:

computeUnionBound

public static BoundingBox computeUnionBound(java.util.List<BoundingVolume> bv)
Computes the bounds of multiple bounding volumes

Parameters:
bv -
Returns:

computeBoundForPoints

public static BoundingBox computeBoundForPoints(Vector3f[] pts,
                                                Transform transform)
Compute bounds from an array of points

Parameters:
pts -
transform -
Returns:

computeBoundForPoints

public static BoundingBox computeBoundForPoints(Vector3f[] pts,
                                                Matrix4f mat)
Compute bounds from an array of points

Parameters:
pts -
mat -
Returns:

updateShadowCamera

public static void updateShadowCamera(Camera shadowCam,
                                      Vector3f[] points)
Updates the shadow camera to properly contain the given points (which contain the eye camera frustum corners)

Parameters:
shadowCam -
points -

updateShadowCamera

public static void updateShadowCamera(GeometryList occluders,
                                      GeometryList receivers,
                                      Camera shadowCam,
                                      Vector3f[] points)
Updates the shadow camera to properly contain the given points (which contain the eye camera frustum corners) and the shadow occluder objects.

Parameters:
occluders -
receivers -
shadowCam -
points -

updateShadowCamera

public static void updateShadowCamera(GeometryList occluders,
                                      GeometryList receivers,
                                      Camera shadowCam,
                                      Vector3f[] points,
                                      GeometryList splitOccluders)
Updates the shadow camera to properly contain the given points (which contain the eye camera frustum corners) and the shadow occluder objects.

Parameters:
occluders -
shadowCam -
points -