pub struct AppState {Show 19 fields
pub fps: u64,
pub camera: Option<Camera>,
pub light: Vec<Light>,
pub ambient_light: Option<Light>,
pub skybox: Option<Object>,
pub skybox_texture: Option<Texture>,
pub objects: Vec<Object>,
pub materials: Vec<Material>,
pub object_selection: Vec<Uuid>,
pub event_injections: Vec<(EventCharacteristic, EventFunction, EventModifiers)>,
pub update_injections: Vec<EventFunction>,
pub gui_injections: Vec<GUIDrawFunction>,
pub post_processes: Vec<Box<dyn PostProcessingEffect>>,
pub display: Option<Display<WindowSurface>>,
pub time: f32,
pub delta_time: f32,
pub render_scale: u32,
pub max_buffers: usize,
pub state_data: Vec<AppStateData>,
/* private fields */
}
Fields§
§fps: u64
§camera: Option<Camera>
§light: Vec<Light>
§ambient_light: Option<Light>
§skybox: Option<Object>
§skybox_texture: Option<Texture>
§objects: Vec<Object>
§materials: Vec<Material>
§object_selection: Vec<Uuid>
§event_injections: Vec<(EventCharacteristic, EventFunction, EventModifiers)>
§update_injections: Vec<EventFunction>
§gui_injections: Vec<GUIDrawFunction>
§post_processes: Vec<Box<dyn PostProcessingEffect>>
§display: Option<Display<WindowSurface>>
§time: f32
§delta_time: f32
§render_scale: u32
§max_buffers: usize
§state_data: Vec<AppStateData>
Implementations§
Source§impl AppState
impl AppState
pub fn new() -> Self
pub fn add_audio(&mut self, clip: AudioClip)
pub fn play_audio_once(&mut self, name: &str)
pub fn play_audio_loop(&mut self, name: &str)
pub fn stop_audio(&mut self, name: &str)
pub fn toggle_pause_audio(&mut self, name: &str)
pub fn to_serializer(&self) -> AppStateSerializer
pub fn inject_serializer( &mut self, serializer: AppStateSerializer, display: Display<WindowSurface>, additive: bool, )
pub fn add_state_data(&mut self, name: &str, data: Box<dyn Any>)
pub fn add_material(&mut self, material: Material)
pub fn get_material(&self, uuid: &Uuid) -> Option<&Material>
pub fn get_material_by_name(&self, name: &str) -> Option<&Material>
pub fn get_state_data_value<T: 'static>(&self, name: &str) -> Option<&T>
pub fn get_state_data_value_mut<T: 'static>( &mut self, name: &str, ) -> Option<&mut T>
pub fn set_state_data_value(&mut self, name: &str, value: Box<dyn Any>)
pub fn inject_gui(&mut self, function: GUIDrawFunction)
pub fn add_post_process(&mut self, post_process: Box<dyn PostProcessingEffect>)
pub fn get_post_processes(&self) -> &Vec<Box<dyn PostProcessingEffect>>
pub fn get_post_processes_mut( &mut self, ) -> &mut Vec<Box<dyn PostProcessingEffect>>
pub fn get_mouse_state(&self) -> &MouseState
pub fn get_mouse_state_mut(&mut self) -> &mut MouseState
pub fn convert_to_arc_mutex(self) -> Arc<Mutex<Self>>
pub fn add_object(&mut self, object: Object)
pub fn get_objects(&self) -> &Vec<Object>
pub fn get_object(&self, name: &str) -> Option<&Object>
pub fn get_object_mut(&mut self, name: &str) -> Option<&mut Object>
pub fn get_object_by_uuid(&self, uuid: &Uuid) -> Option<&Object>
pub fn get_object_by_uuid_mut(&mut self, uuid: Uuid) -> Option<&mut Object>
pub fn get_selected_objects_mut(&mut self) -> Vec<&mut Object>
pub fn add_light(&mut self, light: Light, light_type: LightEmissionType)
pub fn remove_light(&mut self, index: usize, light_type: LightEmissionType)
pub fn get_lights(&self) -> &Vec<Light>
pub fn set_fps(&mut self, fps: u64)
pub fn get_fps(&self) -> u64
pub fn get_objects_mut(&mut self) -> &mut Vec<Object>
pub fn set_camera(&mut self, camera: Camera)
pub fn get_camera(&self) -> &Option<Camera>
pub fn get_camera_mut(&mut self) -> &mut Option<Camera>
pub fn set_renderscale(&mut self, scale: u32)
pub fn get_renderscale(&self) -> u32
pub fn set_max_buffers(&mut self, max_buffers: usize)
pub fn get_max_buffers(&self) -> usize
pub fn inject_event( &mut self, characteristic: EventCharacteristic, function: EventFunction, modifiers: Option<EventModifiers>, )
pub fn inject_update_function(&mut self, function: EventFunction)
pub fn set_skybox(&mut self, skybox: Object)
pub fn set_skybox_from_texture( &mut self, texture: Texture, event_loop: &EventLoop, )
pub fn get_skybox(&self) -> &Option<Object>
pub fn get_skybox_mut(&mut self) -> &mut Option<Object>
Auto Trait Implementations§
impl !Freeze for AppState
impl !RefUnwindSafe for AppState
impl !Send for AppState
impl !Sync for AppState
impl Unpin for AppState
impl !UnwindSafe for AppState
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
impl<F, T> IntoSample<T> for Fwhere
T: FromSample<F>,
fn into_sample(self) -> T
Source§impl<T> Pointable for T
impl<T> Pointable for T
Source§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
Source§fn to_subset(&self) -> Option<SS>
fn to_subset(&self) -> Option<SS>
The inverse inclusion map: attempts to construct
self
from the equivalent element of its
superset. Read moreSource§fn is_in_subset(&self) -> bool
fn is_in_subset(&self) -> bool
Checks if
self
is actually part of its subset T
(and can be converted to it).Source§fn to_subset_unchecked(&self) -> SS
fn to_subset_unchecked(&self) -> SS
Use with care! Same as
self.to_subset
but without any property checks. Always succeeds.Source§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self
to the equivalent element of its superset.