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§

Create a camera builder.

Change view matrix associated to camera.

Trait Implementations§

Formats the value using the given formatter. Read more

Auto Trait Implementations§

Blanket Implementations§

Gets the TypeId of self. Read more
Immutably borrows from an owned value. Read more
Mutably borrows from an owned value. Read more

Returns the argument unchanged.

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

The alignment of pointer.
The type for initializers.
Initializes a with the given initializer. Read more
Dereferences the given pointer. Read more
Mutably dereferences the given pointer. Read more
Drops the object pointed to by the given pointer. Read more
The type returned in the event of a conversion error.
Performs the conversion.
The type returned in the event of a conversion error.
Performs the conversion.