pub struct Camera {
pub look: Vector3,
pub up: Vector3,
pub center: Vector3,
pub span: f64,
pub width: u32,
pub height: u32,
pub near: f64,
}Expand description
An orthographic camera: what a picture shows and where a pixel’s pointer goes.
Fields§
§look: Vector3The direction the eye looks along: unit.
up: Vector3Up the picture: unit, square to look.
center: Vector3The world point at the picture’s centre.
span: f64The world height the picture shows.
width: u32Its size in pixels.
height: u32§near: f64How far before center, along look, a pointer’s ray starts: in
front of everything drawn.
Implementations§
Source§impl Camera
impl Camera
Sourcepub fn fitting(
scene: &SceneState,
look: Vector3,
up: Vector3,
width: u32,
height: u32,
) -> GeopResult<Camera>
pub fn fitting( scene: &SceneState, look: Vector3, up: Vector3, width: u32, height: u32, ) -> GeopResult<Camera>
Looking along look with up up — made square to look, or, if
it runs along look, the world’s axis look runs least along —
framed to everything the scene draws, the part and every part
placed in it, with a margin; to the part’s extent where it draws
nothing.
Sourcepub fn pointer(&self, x: f64, y: f64) -> GeopResult<Pointer>
pub fn pointer(&self, x: f64, y: f64) -> GeopResult<Pointer>
The pointer of the point (x, y) of the picture, in pixels from
its top left corner, y down — the middle of the pixel (i, j) is
(i + 0.5, j + 0.5): a ray along look from in front of
everything drawn, reaching REACH_PX pixels, meaning the first
of what lies under it. What the editor’s hit tests take.
Sourcepub fn through(&self, at: Vector3) -> GeopResult<Pointer>
pub fn through(&self, at: Vector3) -> GeopResult<Pointer>
The pointer through the world point at, along look, reaching as
Camera::pointer’s does.