Expand description
Constructors§
Source§new Camera(params?: ICameraData): Camera
new Camera(params?: ICameraData): Camera
Constructs a Camera instance with the specified parameters. If no parameters are provided, it uses the default camera parameters.
Properties§
protected fovy: number...The field of view angle in the y direction.
protected m Model Matrix: mat4...The model matrix for the camera.
protected m Projection Matrix: mat4...The projection matrix for the camera.
protected m View Matrix: mat4...The view matrix for the camera.
protected w Eye: vec3...The world eye position of the camera.
protected w Eye Dir: vec3...The world eye direction vector of the camera.
protected w Far: number0The far clipping plane distance.
protected w Look At: vec3...The world look-at position of the camera.
protected w Near: number0The near clipping plane distance.
protected w Up: vec3...The world up vector of the camera.
Methods§
Source§getModelViewMatrix(): number[] | Float32Array<ArrayBufferLike>
getModelViewMatrix(): number[] | Float32Array<ArrayBufferLike>
Gets the model-view matrix for the camera.
Source§getProjectionMatrix(): number[] | Float32Array<ArrayBufferLike>
getProjectionMatrix(): number[] | Float32Array<ArrayBufferLike>
Gets the projection matrix for the camera.
Source§resetCamera(wUp: number[], wLookAt: number[], wEye: number[]): void
resetCamera(wUp: number[], wLookAt: number[], wEye: number[]): void
Resets the camera to the initial position and orientation.
Source§screenCoordToWorldDir(x: number, y: number): vec3
screenCoordToWorldDir(x: number, y: number): vec3
Converts screen coordinates to world direction vector.
Source§translate(dx: number, dy: number): void
translate(dx: number, dy: number): void
Translates the camera position by the specified delta values in the x and y directions. The translation is scaled by the current eye distance to maintain consistent movement speed.
Camera class for managing the view parameters and transformations in a 3D space. It provides methods to manipulate the camera position, orientation, and projection.