camera.aspect = window.innerWidth / window.innerHeight;
camera.updateProjectionMatrix();
tsc will indicate
Property 'aspect' does not exist on type 'Camera'
and
Property 'updateProjectionMatrix' does not exist on type 'Camera'
which is not aligned with THREE documentation here:
https://threejs.org/docs/#api/en/cameras/PerspectiveCamera
I believe more properties is missing in the Camera.d.ts, or the typing is still in progress?
I believe more properties is missing in the Camera.d.ts, or the typing is still in progress?
It seems your are mixing Camera with PerspectiveCamera. The base class Camera does not have the property aspect and the method updateProjectionMatrix(). But PerspectiveCamera does.
https://github.com/mrdoob/three.js/blob/3ee4074c68a91c99c156de55ab71b000c9284ce7/src/cameras/PerspectiveCamera.d.ts#L35
https://github.com/mrdoob/three.js/blob/3ee4074c68a91c99c156de55ab71b000c9284ce7/src/cameras/PerspectiveCamera.d.ts#L116
Totally, thanks for that.
Most helpful comment
It seems your are mixing
CamerawithPerspectiveCamera. The base classCameradoes not have the propertyaspectand the methodupdateProjectionMatrix(). ButPerspectiveCameradoes.https://github.com/mrdoob/three.js/blob/3ee4074c68a91c99c156de55ab71b000c9284ce7/src/cameras/PerspectiveCamera.d.ts#L35
https://github.com/mrdoob/three.js/blob/3ee4074c68a91c99c156de55ab71b000c9284ce7/src/cameras/PerspectiveCamera.d.ts#L116