Skip to main content

glam/
dcamera.rs

1// Generated from camera_mod.rs.tera template. Edit the template, not the generated file.
2
3//! View and projection transform helpers.
4//!
5//! This module provides view matrix (`look_at`, `look_to`) and projection matrix (`perspective`,
6//! `orthographic`, `frustum`) constructors.
7//!
8//! ## Choosing a sub-module
9//!
10//! Pick [`lh`] or [`rh`] modules based on your world space coordinate system.
11//!
12//! The view functions in each sub-module transform world space points into Y-up view space while
13//! preserving your world's handedness.
14//!
15//! Note that while the view space methods will preserve the handedness of your world's coordinate
16//! systems, view space is a different coordinate system and will not necessarily be the same as
17//! your world coordinate system, especially if your world up is not +Y.
18//!
19//! There are other possible view space coordinate systems, notably Y-down; however, glam only
20//! provides view and projection functions for left- and right-handed view space coordinate systems.
21//!
22//! The corresponding projection functions expect Y-up view space input with the matching
23//! handedness.
24//!
25//! Within each `proj` sub-module, pick the API-specific constructor:
26//!
27//! | Module     | NDC Z   | NDC Y |
28//! |------------|---------|-------|
29//! | `opengl`   | [-1, 1] | Up    |
30//! | `directx`  | [0, 1]  | Up    |
31//! | `vulkan`   | [0, 1]  | Down  |
32
33mod camera_impl;
34
35/// View functions produce right-handed Y-up view space with
36/// X-right and the negative Z axis pointing forward.
37///
38/// Projection functions expect right-handed Y-up view space input.
39pub mod rh {
40    pub mod proj;
41    pub mod view;
42}
43
44/// View functions produce left-handed Y-up view space with
45/// X-right and the positive Z axis pointing forward.
46///
47/// Projection functions expect left-handed Y-up view space input.
48pub mod lh {
49    pub mod proj;
50    pub mod view;
51}