pub struct CameraBuilder {
    pub(crate) radius: Option<f32>,
    theta: Option<f32>,
    phi: Option<f32>,
    fov: Option<f32>,
    camera_sensitivity: Option<f32>,
    camera_target: Option<Point3<f32>>,
}
Expand description

General Information

The camera builder. Gives some control to user, such as distance from target, initial position arround target, fov, speed, sensitivity and object being pointed at.

Fields

  • radius - Distance to target.
  • theta - One of two angles that dictates camera position arround target (in a sphere).
  • phi - One of two angles that dictates camera position arround target (in a sphere).
  • fov - Field of view of projection matrix.
  • camera_sensitivity - Speed at which camera moves arround target (in a sphere).
  • camera_target - Point at which camera is looking.

Fields§

§radius: Option<f32>§theta: Option<f32>§phi: Option<f32>§fov: Option<f32>§camera_sensitivity: Option<f32>§camera_target: Option<Point3<f32>>

Implementations§

Creates default CameraBuilder

Changes distance (radius) to object centered

Changes object being targeted

Changes initial camera position in a sphere with center camera_target

Changes fov when using projection matrix

Changes camera movement sensitivity arround object being targeted

General Information

Builds a Camera from parameters given.

Details

Camera moves arround a sphere (theta, phi, radius) centered on a point of an object with a given radius. Object on camera is projected on viewport via a projection matrix with a certain fov. There’s no plan to add orthogonal projection. Camera sensitivity helps move camera around sphere.

Parameters
  • self - Every parameter appearing in Camera struct but not here is derived from the ones that do appear
  • mesh_length - Length of mesh to display in order to properly set radius if not given
  • height - Winow height
  • width - Window width

Trait Implementations§

Formats the value using the given formatter. Read more
Returns the “default value” for a type. 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
Read this value from the supplied reader. Same as ReadEndian::read_from_little_endian().
Read this value from the supplied reader. Same as ReadEndian::read_from_big_endian().
Read this value from the supplied reader. Same as ReadEndian::read_from_native_endian().
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.