pub struct Camera<T = f32> {
    pub position: [T; 3],
    pub up: [T; 3],
    pub right: [T; 3],
    pub forward: [T; 3],
}
Expand description

Models a camera with position and directions.

Fields§

§position: [T; 3]

The camera position.

§up: [T; 3]

The up direction.

§right: [T; 3]

The right direction.

§forward: [T; 3]

The forward direction.

Implementations§

Constructs a new camera.

Places the camera at [x, y, z], looking towards pozitive z.

Computes an orthogonal matrix for the camera.

This matrix can be used to transform coordinates to the screen.

Orients the camera to look at a point.

Sets yaw and pitch angle of camera in radians.

Sets forward, up, and right vectors from a Quaternion rotation relative to the positive z-axis

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 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.