Struct dzahui::simulation::camera::cone::Cone

source ·
pub(crate) struct Cone {
    anchorage_point: Point3<f32>,
    direction: Vector3<f32>,
    angle: f32,
}
Expand description

General Information

NOT BEIGN USED AT THE MOMENT

A cone first serves as an object with ‘ray casting’-like functionality to be able to click elements from screen. It transforms viewport coordinates to object coordinates and projects a cone inside this viewport. Then, an intersectrion can ben done to obtain closest object and return it to the user to do something.

Fields

  • anchorage_point - Point from where the cone starts. Normally coincides with near plane of camera
  • direction - Direction the cone will take. Given mouse position, a line is determined inside viewport. Near and far coordinates are determined and the direction vector of the line generated (by near and far points) is used
  • angle - How much should the cone be open

Fields§

§anchorage_point: Point3<f32>§direction: Vector3<f32>§angle: f32

Implementations§

Function to create new instance. Normalizes direction vector.

General Information

Change cone given mouse input. This function is normally used along cone and window. Steps reffered to in struct definition, are performed here.

Parameters
  • mouse_coordinates - viewport coordinates to change anchorage point.
  • projection_matrix - camera projection matrix to find reverse transformation.
  • window_width - original window width needed to normalize viewport coordinates
  • window_height - original window height needed to normalize viewport coordinates

Matrix to translate vertex to a given location (normally determined by a mesh instance).

Obtain center coordinates as viewed from camera

General Information

Determine closest intersection given some vertices (sextuples of points) and current cone status. Only one vertex is returned with id.

Parameters
  • &self - To determine cone location.
  • vertices - Vertices check wether they’re inside or outside the cone
  • view_matrix - Camera view matrix needed to see where a vertex is (in view space).

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.