graphics/lib.rs
1#![allow(mixed_script_confusables)] // Theta in meshes
2#![allow(clippy::too_many_arguments)]
3
4//! A 3D rendering engine for rust programs, with GUI integration
5//!
6//! This library is a framework for building PC applications that have 3D graphics, and a GUI. It uses
7//! the [WGPU toolkit](https://wgpu.rs/) with Vulkan backend, and [EGUI](https://docs.rs/egui/latest/egui/).
8//! It works on Windows, Linux, and Mac.
9//!
10//! This is intended as a general-purpose 3D visualization tool.
11//! Example use cases including wave-function analysis, n-body simulations, and protein structure viewing.
12//! It's also been used to visualize UAS attitude in preflight software. Its goals are to be intuitive and flexible.
13
14#[cfg(feature = "app_utils")]
15pub mod app_utils;
16mod camera;
17mod gauss;
18mod graphics;
19mod gui;
20mod input;
21pub mod lighting;
22mod meshes;
23mod system;
24mod texture;
25mod types;
26mod window;
27
28pub use camera::Camera;
29pub use gauss::Gaussian;
30pub use graphics::{EntityUpdate, FWD_VEC, RIGHT_VEC, UP_VEC};
31pub use input::{InputsCommanded, adjust_camera_free, arc_rotation};
32pub use lighting::{LightType, Lighting, PointLight};
33pub use system::run;
34pub use types::{
35 ControlScheme, EngineUpdates, Entity, GraphicsSettings, InputSettings, Mesh, Scene,
36 ScrollBehavior, TextOverlay, UiLayout, UiSettings, Vertex,
37};
38// Re-export winit DeviceEvents for use in the API; this prevents the calling
39// lib from needing to use winit as a dependency directly.
40// todo: the equiv for mouse events too. And in the future, Gamepad events.
41pub use winit::{
42 self,
43 event::{self, DeviceEvent, ElementState, WindowEvent},
44};
45
46// A helper macro. Not intended for use outside of this crate.
47#[macro_export]
48macro_rules! copy_ne {
49 ($dest:expr, $src:expr, $range:expr) => {{ $dest[$range].copy_from_slice(&$src.to_ne_bytes()) }};
50}