Crate graphics

Source
Expand description

A 3D rendering engine for rust programs, with GUI integration

This library is a framework for building PC applications that have 3D graphics, and a GUI. It uses the WGPU toolkit with Vulkan backend, and EGUI. It works on Windows, Linux, and Mac.

This is intended as a general-purpose 3D visualization tool. Example use cases including wave-function analysis, n-body simulations, and protein structure viewing. It’s also been used to visualize UAS attitude in preflight software. Its goals are to be intuitive and flexible.

Re-exports§

pub use lighting::LightType;
pub use lighting::Lighting;
pub use lighting::PointLight;
pub use winit;

Modules§

event
The Event enum and assorted supporting types.
lighting

Structs§

Camera
EngineUpdates
This struct is exposed in the API, and passed by callers to indicate in the render, event, GUI etc update functions, if the engine should update various things. When you change the relevant part of the scene, the callbacks (event, etc) should set the corresponding flag in this struct.
Entity
Represents an entity in the world. This is not fundamental to the WGPU system.
Gaussian
This is publicly accessible; set by the user, and stored in Scene.
GraphicsSettings
InputSettings
These sensitivities are in units (position), or radians (orientation) per second.
InputsCommanded
Mesh
Scene
UiSettings
GUI settings
Vertex
A general mesh. This should be sufficiently versatile to use for a number of purposes.

Enums§

ControlScheme
Default controls. Provides easy defaults. For maximum flexibility, choose None, and implement controls in the event_handler function.
DeviceEvent
Represents raw hardware events that are not associated with any particular window.
ElementState
Describes the input state of a key.
ScrollBehavior
UiLayout
WindowEvent
Describes an event from a [Window].

Constants§

FWD_VEC
RIGHT_VEC
UP_VEC

Functions§

adjust_camera_free
Adjust the camera orientation and position. Return if there was a change, so we know to update the buffer. For the free (6DOF first-person) camera.
run
This is the entry point to the renderer. It’s called by the application to initialize the event loop. It maintains ownership of the user state, and can be interacted with through the _handler callback functions.