Struct dzahui::simulation::camera::Camera
source · pub(crate) struct Camera {
pub(crate) camera_position: Point3<f32>,
camera_target: Point3<f32>,
pub(crate) view_matrix: Matrix4<f32>,
pub(crate) active_view_change: bool,
pub(crate) projection_matrix: Matrix4<f32>,
up_vector: Vector3<f32>,
pub(crate) camera_sensitivity: f32,
pub(crate) theta: f32,
pub(crate) phi: f32,
pub(crate) radius: f32,
}
Expand description
General Information
Camera struct. Makes movement arround viewport possible. Always uses projection matrix and moves arround a sphere given a target.
Fields
camera_position
- Camera position from original coordinate system (world coordinate system).camera_target
- Normally set to (0,0,0) but can change. What camera points at.view_matrix
- How camera ends up viewing object.active_view_change
- Wether we can change view matrix. Normally used in callback functions inside loop.projection_matrix
- Perspective matrix to see final results in screen.up_vector
- Vector to create a coordinate system for camera relative to it’s position (position ends up in (0,0,0) in default mode).camera_sensitivity
- How much should camera get close when zooming and moving arround objective.theta
- y axis - position angle to move camera.phi
- xz plane - position angle to move camera.radius
- how far away camera is from object.
Fields§
§camera_position: Point3<f32>
§camera_target: Point3<f32>
§view_matrix: Matrix4<f32>
§active_view_change: bool
§projection_matrix: Matrix4<f32>
§up_vector: Vector3<f32>
§camera_sensitivity: f32
§theta: f32
§phi: f32
§radius: f32
Implementations§
source§impl Camera
impl Camera
sourcepub fn builder() -> CameraBuilder
pub fn builder() -> CameraBuilder
Create a camera builder.
sourcepub(crate) fn modify_view_matrix(&mut self)
pub(crate) fn modify_view_matrix(&mut self)
Change view matrix associated to camera.