CameraMaths beta
Class of @v12-engine/client/lite-views
export declare class CameraMathsThe matrices of one camera at one size of its view, and what is asked of them: update works them out, the rest read them
Members
eye
readonly eye: {
x: number;
y: number;
z: number;
};Where the camera stands
forwardTo
forwardTo(out: XYZ): XYZ;The way the camera looks, of length 1, into out
groundAt
groundAt(x: number, y: number, terrain: Terrain, reach?: number): Vec2 | null;The ground under a point of the view, as it rises and falls: the ray it was found along is left in ray
height
height: number;Its height in CSS pixels
inverse
readonly inverse: Mat4;What undoes both: what a ray is made by
project
project(x: number, y: number, z: number): {
x: number;
y: number;
} | null;Position in the view of a point of the world, or null when it is behind the camera: a new point each time
projection
readonly projection: Mat4;Its lens
projectTo
projectTo(x: number, y: number, z: number, out: {
x: number;
y: number;
z?: number;
}): boolean;Puts the position in the view of a point of the world into out, in CSS pixels from its top left, with its depth where out has a z. False, and out left alone, when it is behind the camera or past what it sees
ray
readonly ray: PickRay;The ray the ground under a point was last found along (groundAt): a pick reads it after
rayTo
rayTo(x: number, y: number, out: PickRay): PickRay;The ray of the world under a point of the view, into out
rightTo
rightTo(out: Vec2): Vec2;The camera's right along the ground, of length 1, into out: how wide a body is seen
update
update(camera: ViewCamera, width: number, height: number, aspect?: number): this;The matrices of a camera for a view width by height CSS pixels, aspect times as wide as high where its drawing pixels say otherwise than those do (the renderer's is canvas.width / canvas.height)
view
readonly view: Mat4;The world as the camera sees it
viewProjection
readonly viewProjection: Mat4;Both: what a point is projected by, without the renderer's jitter
width
width: number;The view's size in CSS pixels: what a point of the screen is measured in