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

Method copyCameraSettings

src/materials/SSAOMaterial.js:823–845  ·  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

821 */
822
823 copyCameraSettings(camera) {
824
825 if(camera) {
826
827 this.uniforms.cameraNearFar.value.set(camera.near, camera.far);
828 this.uniforms.projectionMatrix.value.copy(camera.projectionMatrix);
829 this.uniforms.inverseProjectionMatrix.value.copy(camera.projectionMatrix).invert();
830
831 if(camera instanceof PerspectiveCamera) {
832
833 this.defines.PERSPECTIVE_CAMERA = "1";
834
835 } else {
836
837 delete this.defines.PERSPECTIVE_CAMERA;
838
839 }
840
841 this.needsUpdate = true;
842
843 }
844
845 }
846
847 /**
848 * Sets the size of this object.

Callers 10

constructorMethod · 0.95
adoptCameraSettingsMethod · 0.95
mainCameraMethod · 0.45
setSizeMethod · 0.45
mainCameraMethod · 0.45
mainCameraMethod · 0.45
constructorMethod · 0.45
mainCameraMethod · 0.45
mainCameraMethod · 0.45
mainCameraMethod · 0.45

Calls 2

setMethod · 0.80
copyMethod · 0.80

Tested by

no test coverage detected