aboutsummaryrefslogtreecommitdiffstats
path: root/ardor3d-effects
diff options
context:
space:
mode:
Diffstat (limited to 'ardor3d-effects')
-rw-r--r--ardor3d-effects/src/main/java/com/ardor3d/extension/shadow/map/ParallelSplitShadowMapPass.java33
1 files changed, 22 insertions, 11 deletions
diff --git a/ardor3d-effects/src/main/java/com/ardor3d/extension/shadow/map/ParallelSplitShadowMapPass.java b/ardor3d-effects/src/main/java/com/ardor3d/extension/shadow/map/ParallelSplitShadowMapPass.java
index 4c6a122..8205049 100644
--- a/ardor3d-effects/src/main/java/com/ardor3d/extension/shadow/map/ParallelSplitShadowMapPass.java
+++ b/ardor3d-effects/src/main/java/com/ardor3d/extension/shadow/map/ParallelSplitShadowMapPass.java
@@ -168,7 +168,7 @@ public class ParallelSplitShadowMapPass extends Pass {
/** Shadow color and transparency. */
private final ColorRGBA _shadowColor = new ColorRGBA(0.0f, 0.0f, 0.0f, 0.5f);
- /** Light -> Camera transformation matrix. */
+ /** Light to Camera transformation matrix. */
private final Matrix4 _shadowMatrix = new Matrix4();
/** Bounding of scene for packing frustum. */
@@ -237,10 +237,12 @@ public class ParallelSplitShadowMapPass extends Pass {
/**
* Create a pssm shadow map pass casting shadows from a light with the direction given.
*
+ * @param light
+ * the directional light
* @param shadowMapSize
* The size of the shadow map texture
* @param numOfSplits
- * the num of splits
+ * the number of splits
*/
public ParallelSplitShadowMapPass(final Light light, final int shadowMapSize, final int numOfSplits) {
_light = light;
@@ -291,7 +293,7 @@ public class ParallelSplitShadowMapPass extends Pass {
* Initialize the pass render states.
*
* @param r
- * the r
+ * the renderer
*/
public void init(final Renderer r) {
if (_initialised) {
@@ -487,8 +489,8 @@ public class ParallelSplitShadowMapPass extends Pass {
calculateOptimalLightFrustum(_pssmCam._corners, _pssmCam._center);
if (_drawDebug) {
- boundingSphere
- .setData(frustumBoundingSphere.getCenter(), 10, 10, frustumBoundingSphere.getRadius());
+ boundingSphere.setData(frustumBoundingSphere.getCenter(), 10, 10,
+ frustumBoundingSphere.getRadius());
boundingSphere.draw(r);
}
} else if (_light instanceof PointLight) {
@@ -497,8 +499,8 @@ public class ParallelSplitShadowMapPass extends Pass {
// Debug draw light frustum for current split
if (_drawDebug) {
- drawFrustum(r, _shadowMapRenderer.getCamera(), new ColorRGBA(1, 1, (iSplit + 1) / (float) _numOfSplits,
- 1), (short) 0xFFFF, true);
+ drawFrustum(r, _shadowMapRenderer.getCamera(),
+ new ColorRGBA(1, 1, (iSplit + 1) / (float) _numOfSplits, 1), (short) 0xFFFF, true);
}
// Render shadowmap from light view for current split
@@ -559,7 +561,7 @@ public class ParallelSplitShadowMapPass extends Pass {
*
* @param frustumCorners
* the frustum corners
- * @param center
+ * @param centerFrustum
* the center
*/
private void calculateOptimalLightFrustum(final Vector3[] frustumCorners, final ReadOnlyVector3 centerFrustum) {
@@ -628,7 +630,9 @@ public class ParallelSplitShadowMapPass extends Pass {
* maps...
*
* @param frustumCorners
+ * the frustum corners
* @param center
+ * the center
*/
private void calculateOptimalLightFrustumOld(final Vector3[] frustumCorners, final ReadOnlyVector3 center) {
final Camera shadowCam = _shadowMapRenderer.getCamera();
@@ -792,6 +796,8 @@ public class ParallelSplitShadowMapPass extends Pass {
*
* @param index
* shadow map texture index to update
+ * @param r
+ * the renderer
*/
private void updateShadowMap(final int index, final Renderer r) {
@@ -827,8 +833,8 @@ public class ParallelSplitShadowMapPass extends Pass {
// Create a matrix going from light to camera space
final Camera cam = ContextManager.getCurrentContext().getCurrentCamera();
_shadowMatrix.set(cam.getModelViewMatrix()).invertLocal();
- _shadowMatrix.multiplyLocal(_shadowMapRenderer.getCamera().getModelViewProjectionMatrix()).multiplyLocal(
- SCALE_BIAS_MATRIX);
+ _shadowMatrix.multiplyLocal(_shadowMapRenderer.getCamera().getModelViewProjectionMatrix())
+ .multiplyLocal(SCALE_BIAS_MATRIX);
_shadowMapTexture[index].setTextureMatrix(_shadowMatrix);
}
@@ -901,7 +907,8 @@ public class ParallelSplitShadowMapPass extends Pass {
* Checks if a bounding volume is valid.
*
* @param volume
- * @return
+ * the bounding volume
+ * @return <code>true</code> if this bounding volume is valid
*/
private boolean boundIsValid(final BoundingVolume volume) {
if (!Vector3.isValid(volume.getCenter())) {
@@ -1244,6 +1251,8 @@ public class ParallelSplitShadowMapPass extends Pass {
* the cam
* @param color
* the color
+ * @param pattern
+ * the pattern
* @param drawOriginConnector
* whether or not to draw a connector
*/
@@ -1265,6 +1274,8 @@ public class ParallelSplitShadowMapPass extends Pass {
* the f far
* @param color
* the color
+ * @param pattern
+ * the pattern
* @param drawOriginConnector
* whether or not to draw a connector
*/