CubeCamera constructor

CubeCamera(
  1. double near,
  2. double far,
  3. WebGLCubeRenderTarget renderTarget
)

Implementation

CubeCamera(double near, double far, this.renderTarget) {
  type = 'CubeCamera';

  if (renderTarget.isWebGLCubeRenderTarget != true) {
    console.warning('CubeCamera: The constructor now expects an instance of WebGLCubeRenderTarget as third parameter.');
    return;
  }

  cameraPX = PerspectiveCamera(fov, aspect, near, far);
  cameraPX.layers = layers;
  cameraPX.up.setValues(0, -1, 0);
  cameraPX.lookAt(Vector3(1, 0, 0));
  add(cameraPX);

  cameraNX = PerspectiveCamera(fov, aspect, near, far);
  cameraNX.layers = layers;
  cameraNX.up.setValues(0, -1, 0);
  cameraNX.lookAt(Vector3(-1, 0, 0));
  add(cameraNX);

  cameraPY = PerspectiveCamera(fov, aspect, near, far);
  cameraPY.layers = layers;
  cameraPY.up.setValues(0, 0, 1);
  cameraPY.lookAt(Vector3(0, 1, 0));
  add(cameraPY);

  cameraNY = PerspectiveCamera(fov, aspect, near, far);
  cameraNY.layers = layers;
  cameraNY.up.setValues(0, 0, -1);
  cameraNY.lookAt(Vector3(0, -1, 0));
  add(cameraNY);

  cameraPZ = PerspectiveCamera(fov, aspect, near, far);
  cameraPZ.layers = layers;
  cameraPZ.up.setValues(0, -1, 0);
  cameraPZ.lookAt(Vector3(0, 0, 1));
  add(cameraPZ);

  cameraNZ = PerspectiveCamera(fov, aspect, near, far);
  cameraNZ.layers = layers;
  cameraNZ.up.setValues(0, -1, 0);
  cameraNZ.lookAt(Vector3(0, 0, -1));
  add(cameraNZ);
}