The translation boundaries of the camera in the world coordinate system.
The position of the camera in the world coordinate system.
The height of the viewport. (The height of the canvas in css pixels)
The width of the viewport. (The width of the canvas in css pixels)
The boundaries of the zoom level of the camera.
The boundaries of the zoom level of the camera.
The zoom level of the camera.
The width of the viewport. (The width of the canvas in css pixels)
The height of the viewport. (The height of the canvas in css pixels)
The position of the camera in the world coordinate system
The rotation of the camera in the world coordinate system
The zoom level of the camera
The boundaries of the camera in the world coordinate system
The boundaries of the zoom level of the camera
The boundaries of the rotation of the camera
The order of the transformation is as follows:
The device pixel ratio of the canvas
Whether to align the coordinate system to the camera's position
The transformation matrix
This function is used to set the position of the camera.This function has a guard that checks if the destination point is within the boundaries of the camera. If the destination point is not within the boundaries, the function will return false and the position will not be updated. If the destination point is within the boundaries, the function will return true and the position will be updated.
The destination point of the camera.
Whether the position is set successfully.
This function is used to set the zoom level of the camera.This function has a guard that checks if the zoom level is within the boundaries of the camera. If the zoom level is not within the boundaries, the function will return false and the zoom level will not be updated. If the zoom level is within the boundaries, the function will return true and the zoom level will be updated.
The zoom level of the camera.
Whether the zoom level is set successfully.
This is the base class for the camera. It is used to create a camera that can be used to view a board.
If there's only one class that you want to use in this library, it is this one. The is the back bone of the board camera system.
With the CameraRig class, you can create a camera system that can be used to achieve the infinite canvas effect.
This class is not observable (you can not register a callback for camera state changes). If you need to observe the camera state, use the DefaultBoardCamera class instead.