[][src]Struct molecules::application::Application

pub struct Application {
    width: u32,
    height: u32,
    device: Device,
    queue: Queue,
    start_time: SystemTime,
    pub camera: RotationCamera,
    pub camera_changed: bool,
    voxel_grid: VoxelGrid,
    raymarch_globals: RaymarchGlobals,
    raymarch_globals_buffer: Buffer,
    ssao_globals_buffer: Buffer,
    raymarch_pipeline: RaymarchPipeline,
    render_pipeline: RenderPipeline,
    ssao_pipeline: SsaoPipeline,
    gbuffer_positions: TextureView,
    gbuffer_normals: TextureView,
    output_texture: TextureView,
    sdf_default: Buffer,
    sdf_texture: Texture,
    sdf_texture_view: TextureView,
    mouse_pressed: bool,
    mouse_position: PhysicalPosition<f64>,
}

Fields

width: u32

Width of the window

height: u32

Height of the window

device: Device

Device used for rendering

queue: Queue

Main queue to which GPU commands are sent

start_time: SystemTime

Time of initilization of program. Used for animation.

camera: RotationCamera

Camera of the application.

camera_changed: bool

Holds information whether camera was changed between frames. The information is used for accumulation of result.

voxel_grid: VoxelGrid

Voxel grid containing atoms of the molecule.

raymarch_globals: RaymarchGlobals

Global variables for ray marching passed to GPU.

raymarch_globals_buffer: Buffer

GPU buffer for raymarch_globals.

ssao_globals_buffer: Buffer

Global variables for SSAO computation passed to GPU.

raymarch_pipeline: RaymarchPipeline

Pipeline for ray marching.

render_pipeline: RenderPipeline

Pipeline that renders the sphere marched result to the window.

ssao_pipeline: SsaoPipeline

Pipeline that adds SSAO to the sphere marched result.

gbuffer_positions: TextureViewgbuffer_normals: TextureViewoutput_texture: TextureViewsdf_default: Buffersdf_texture: Texture

Texture where signed distance field is stored. Used to progressively enhance view when camera did not change between frames.

sdf_texture_view: TextureViewmouse_pressed: boolmouse_position: PhysicalPosition<f64>

Methods

impl Application[src]

pub async fn new<'_, '_>(
    width: u32,
    height: u32,
    surface: &'_ Surface,
    file_name: Option<&'_ str>
) -> Self
[src]

Initialized the application.

pub fn resize(&mut self, width: u32, height: u32)[src]

Called when window is resized. Recreates textures for rendering.

pub fn render(&mut self, frame: &TextureView)[src]

Called each frame to render.

pub fn window_event(&mut self, event: &WindowEvent)[src]

pub fn device_event(&mut self, event: &DeviceEvent)[src]

pub fn device(&self) -> &Device[src]

Returns reference to the device used by the application.

pub fn queue_mut(&self) -> &Queue[src]

Returns reference to the device used by the application.

fn update_raymarch_globals(&mut self)[src]

pub fn solvent_radius(&self) -> f32[src]

pub fn set_solvent_radius(&mut self, solvent_radius: f32)[src]

pub fn max_neighbours(&self) -> i32[src]

pub fn set_max_neighbours(&mut self, max_neighbours: i32)[src]

Auto Trait Implementations

impl !RefUnwindSafe for Application

impl Send for Application

impl Sync for Application

impl Unpin for Application

impl UnwindSafe for Application

Blanket Implementations

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<T> Borrow<T> for T where
    T: ?Sized
[src]

impl<T> BorrowMut<T> for T where
    T: ?Sized
[src]

impl<T> From<T> for T[src]

impl<T, U> Into<U> for T where
    U: From<T>, 
[src]

impl<T> Same<T> for T

type Output = T

Should always be Self

impl<SS, SP> SupersetOf<SS> for SP where
    SS: SubsetOf<SP>, 

impl<T, U> TryFrom<U> for T where
    U: Into<T>, 
[src]

type Error = Infallible

The type returned in the event of a conversion error.

impl<T, U> TryInto<U> for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.

impl<V, T> VZip<V> for T where
    V: MultiLane<T>,