MCPcopy Create free account
hub / github.com/pmndrs/postprocessing / copyCameraSettings

Method copyCameraSettings

src/materials/EffectMaterial.js:370–391  ·  view source on GitHub ↗

* Copies the settings of the given camera. * * @param {Camera} camera - A camera.

(camera)

Source from the content-addressed store, hash-verified

368 */
369
370 copyCameraSettings(camera) {
371
372 if(camera) {
373
374 this.uniforms.cameraNear.value = camera.near;
375 this.uniforms.cameraFar.value = camera.far;
376
377 if(camera instanceof PerspectiveCamera) {
378
379 this.defines.PERSPECTIVE_CAMERA = "1";
380
381 } else {
382
383 delete this.defines.PERSPECTIVE_CAMERA;
384
385 }
386
387 this.needsUpdate = true;
388
389 }
390
391 }
392
393 /**
394 * Sets the resolution.

Callers 2

constructorMethod · 0.95
adoptCameraSettingsMethod · 0.95

Calls

no outgoing calls

Tested by

no test coverage detected