MCPcopy Create free account
hub / github.com/melonjs/melonJS / _updateProjectionMatrix

Method _updateProjectionMatrix

packages/melonjs/src/camera/camera2d.ts:302–319  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

300 /** @ignore */
301 // update the projection matrix based on the projection frame (a rectangle)
302 _updateProjectionMatrix(): void {
303 this.projectionMatrix.ortho(
304 0,
305 this.width,
306 this.height,
307 0,
308 this.near,
309 this.far,
310 );
311 // Mirror the screen ortho into `screenProjection` so default-
312 // camera floating renderables can swap to it in `Container.draw`
313 // without a no-op risk. Non-default cameras overwrite this in
314 // `Camera2d.draw` (line ~946) with a screen-relative ortho;
315 // Camera3d overrides this method and sets `screenProjection`
316 // to a screen-space ortho separate from its perspective
317 // `projectionMatrix`.
318 this.screenProjection.copy(this.projectionMatrix);
319 }
320
321 /** @ignore */
322 _followH(target: Vector2d | Vector3d): number {

Callers 4

constructorMethod · 0.95
setViewportMethod · 0.95
resetMethod · 0.95
resizeMethod · 0.95

Calls 2

orthoMethod · 0.80
copyMethod · 0.45

Tested by

no test coverage detected