Skip to content

Commit

Permalink
PerspectiveCamera: getViewBounds(), getViewSize() (#777)
Browse files Browse the repository at this point in the history
* PerspectiveCamera: getViewBounds(), getViewSize()

* Fix import
  • Loading branch information
Methuselah96 authored Jan 23, 2024
1 parent 8678728 commit 44043e2
Showing 1 changed file with 13 additions and 0 deletions.
13 changes: 13 additions & 0 deletions types/three/src/cameras/PerspectiveCamera.d.ts
Original file line number Diff line number Diff line change
@@ -1,4 +1,5 @@
import { Camera } from './Camera.js';
import { Vector2 } from '../math/Vector2.js';

/**
* Camera that uses {@link https://en.wikipedia.org/wiki/Perspective_(graphical) | perspective projection}.
Expand Down Expand Up @@ -148,6 +149,18 @@ export class PerspectiveCamera extends Camera {
*/
getFilmHeight(): number;

/**
* Computes the 2D bounds of the camera's viewable rectangle at a given distance along the viewing direction.
* Sets minTarget and maxTarget to the coordinates of the lower-left and upper-right corners of the view rectangle.
*/
getViewBounds(distance: number, minTarget: Vector2, maxTarget: Vector2): void;

/**
* Computes the width and height of the camera's viewable rectangle at a given distance along the viewing direction.
* Copies the result into the target Vector2, where x is width and y is height.
*/
getViewSize(distance: number, minTarget: Vector2, maxTarget: Vector2): void;

/**
* Sets an offset in a larger frustum.
* @remarks
Expand Down

0 comments on commit 44043e2

Please sign in to comment.