PointLightShadow constructor
PointLightShadow()
Creates a new name
. This is not intended to be called directly - it is
called internally by PointLight.
Implementation
PointLightShadow():super(PerspectiveCamera(90, 1, 0.5, 500)) {
frameExtents.setFrom(Vector2(4, 2));
viewportCount = 6;
viewports.removeAt(0);
viewports.addAll([
// These viewports map a cube-map onto a 2D texture with the
// following orientation:
//
// xzXZ
// y Y
//
// X - Positive x direction
// x - Negative x direction
// Y - Positive y direction
// y - Negative y direction
// Z - Positive z direction
// z - Negative z direction
// positive X
Vector4(2, 1, 1, 1),
// negative X
Vector4(0, 1, 1, 1),
// positive Z
Vector4(3, 1, 1, 1),
// negative Z
Vector4(1, 1, 1, 1),
// positive Y
Vector4(3, 0, 1, 1),
// negative Y
Vector4(1, 0, 1, 1)
]);
_cubeDirections = [
Vector3(1, 0, 0),
Vector3(-1, 0, 0),
Vector3(0, 0, 1),
Vector3(0, 0, -1),
Vector3(0, 1, 0),
Vector3(0, -1, 0)
];
_cubeUps = [
Vector3(0, 1, 0),
Vector3(0, 1, 0),
Vector3(0, 1, 0),
Vector3(0, 1, 0),
Vector3(0, 0, 1),
Vector3(0, 0, -1)
];
}