Package com.ardor3d.extension.shadow.map
Class PSSMCamera
java.lang.Object
com.ardor3d.renderer.Camera
com.ardor3d.extension.shadow.map.PSSMCamera
- All Implemented Interfaces:
Savable
,Externalizable
,Serializable
Camera with additional pssm related functionality.
- See Also:
-
Nested Class Summary
Nested classes/interfaces inherited from class com.ardor3d.renderer.Camera
Camera.FrustumIntersect, Camera.ProjectionMode
-
Field Summary
Modifier and TypeFieldDescriptionprotected final Vector3
The center of the camera frustum.protected final Vector3[]
The corners of the camera frustum.protected final Vector3
Temporary vector used for storing extents during corner calculations.protected double
The lambda value used in split distance calculations.protected double
The maximum far plane distance used when packing the frustum.protected double[]
The storage place for calculated split distances.Fields inherited from class com.ardor3d.renderer.Camera
_coeffBottom, _coeffLeft, _coeffRight, _coeffTop, _depthRangeDirty, _depthRangeFar, _depthRangeNear, _direction, _fovY, _frameDirty, _frustumBottom, _frustumDirty, _frustumFar, _frustumLeft, _frustumNear, _frustumRight, _frustumTop, _height, _left, _location, _matrixBuffer, _modelView, _planeQuantity, _projection, _tempVector, _up, _viewPortBottom, _viewPortDirty, _viewPortLeft, _viewPortRight, _viewPortTop, _width, _worldPlane, BOTTOM_PLANE, FAR_PLANE, FRUSTUM_PLANES, LEFT_PLANE, MAX_WORLD_PLANES, NEAR_PLANE, RIGHT_PLANE, TOP_PLANE
-
Constructor Summary
ConstructorDescriptionInstantiates a new PSSM camera.PSSMCamera
(int width, int height) Instantiates a new PSSM camera.PSSMCamera
(Camera source) Instantiates a new PSSM camera. -
Method Summary
Modifier and TypeMethodDescriptionvoid
calculateFrustum
(double fNear, double fFar) Calculate frustum corners and center.void
calculateSplitDistances
(int splitCount) Calculates the distances from view location for view frustum splits using the "practical split scheme".double
Gets the lambda.double
Gets the max far plane distance.double[]
Gets the split distances.void
pack
(BoundingVolume sceneBounds) Compress this camera's near and far frustum planes to be smaller if possible, using the given bounds as a measure.void
setLambda
(double lambda) Sets the lambda.void
setMaxFarPlaneDistance
(double maxFarPlaneDistance) Sets the max far plane distance.void
Methods inherited from class com.ardor3d.renderer.Camera
apply, applyModelViewMatrix, applyProjectionMatrix, applyViewport, contains, getClassTag, getCurrentCamera, getDepthRangeFar, getDepthRangeNear, getDirection, getFovY, getFrustumBottom, getFrustumCoordinates, getFrustumCoordinates, getFrustumFar, getFrustumLeft, getFrustumNear, getFrustumRight, getFrustumTop, getHeight, getLeft, getLocation, getModelViewMatrix, getModelViewProjectionInverseMatrix, getModelViewProjectionMatrix, getNormalizedDeviceCoordinates, getNormalizedDeviceCoordinates, getPickRay, getPlaneState, getProjectionMatrix, getProjectionMode, getScreenCoordinates, getScreenCoordinates, getUp, getViewPortBottom, getViewPortLeft, getViewPortRight, getViewPortTop, getWidth, getWorldCoordinates, getWorldCoordinates, isFrameDirty, lookAt, lookAt, normalize, onFrameChange, onFrustumChange, onViewPortChange, read, readExternal, resize, set, setAxes, setAxes, setDepthRangeFar, setDepthRangeNear, setDirection, setFrame, setFrame, setFrame, setFrustum, setFrustum, setFrustumBottom, setFrustumFar, setFrustumLeft, setFrustumNear, setFrustumPerspective, setFrustumRight, setFrustumTop, setLeft, setLocation, setLocation, setPlaneState, setProjectionMatrix, setProjectionMode, setUp, setViewPort, setViewPortBottom, setViewPortLeft, setViewPortRight, setViewPortTop, toString, update, updateModelViewMatrix, updateProjectionMatrix, write, writeExternal
-
Field Details
-
_splitDistances
protected double[] _splitDistancesThe storage place for calculated split distances. -
_lambda
protected double _lambdaThe lambda value used in split distance calculations. -
_corners
The corners of the camera frustum. -
_center
The center of the camera frustum. -
_extents
Temporary vector used for storing extents during corner calculations. -
_maxFarPlaneDistance
protected double _maxFarPlaneDistanceThe maximum far plane distance used when packing the frustum.
-
-
Constructor Details
-
PSSMCamera
public PSSMCamera()Instantiates a new PSSM camera. -
PSSMCamera
public PSSMCamera(int width, int height) Instantiates a new PSSM camera.- Parameters:
width
- the widthheight
- the height
-
PSSMCamera
Instantiates a new PSSM camera.- Parameters:
source
- the source
-
-
Method Details
-
calculateSplitDistances
public void calculateSplitDistances(int splitCount) Calculates the distances from view location for view frustum splits using the "practical split scheme".- Parameters:
splitCount
- the split count- See Also:
-
pack
Compress this camera's near and far frustum planes to be smaller if possible, using the given bounds as a measure.- Parameters:
sceneBounds
- the scene bounds
-
updateMaxCameraFar
public void updateMaxCameraFar() -
calculateFrustum
public void calculateFrustum(double fNear, double fFar) Calculate frustum corners and center.- Parameters:
fNear
- the near distancefFar
- the far distance
-
getLambda
public double getLambda()Gets the lambda.- Returns:
- the lambda
-
setLambda
public void setLambda(double lambda) Sets the lambda.- Parameters:
lambda
- the new lambda
-
getSplitDistances
public double[] getSplitDistances()Gets the split distances.- Returns:
- the split distances
-
getMaxFarPlaneDistance
public double getMaxFarPlaneDistance()Gets the max far plane distance.- Returns:
- the max far plane distance
-
setMaxFarPlaneDistance
public void setMaxFarPlaneDistance(double maxFarPlaneDistance) Sets the max far plane distance.- Parameters:
maxFarPlaneDistance
- the new max far plane distance
-