pub struct Camera3d {
pub yaw: f32,
pub pitch: f32,
pub distance: f32,
pub fov: f32,
pub focus: f32,
pub aperture: f32,
}Expand description
An orbit camera, as a preset binds it (ADR-0257).
Fields§
§yaw: f32Turn about world +y, in radians. A preset writing time * 0.05 here
orbits slowly.
pitch: f32Elevation above the xz plane, in radians; clamped short of a quarter
turn either way.
distance: f32Eye to orbit target, in world units.
fov: f32The vertical field of view, in radians, before zoom divides it.
focus: f32Where the focal plane sits in the scene’s volume: 0 at its nearest
extent, 1 at its farthest. Normalized so an author never deals in world
units; CameraView::focal_depth resolves it against the volume.
aperture: f32The lens’s aperture, as the circle of confusion in pixels a point would
have at infinite depth. 0 is a pinhole and blurs nothing.
Implementations§
Source§impl Camera3d
impl Camera3d
Sourcepub fn view(&self, aspect: f32, zoom: f32, pan: [f32; 2]) -> CameraView
pub fn view(&self, aspect: f32, zoom: f32, pan: [f32; 2]) -> CameraView
The view this camera gives onto a render target of aspect (width over
height), under the engine-wide zoom and pan (ADR-0018).
Every input is taken as a raw bound value and made safe here, once: a non-finite or out-of-range yaw, pitch, distance, field of view, zoom or aspect resolves to the nearest usable camera rather than a NaN matrix.