CubeCamera constructor

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

Implementation

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

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

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

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

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

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

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

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