Struct AppState

Source
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

Source

pub fn new() -> Self

Source

pub fn add_audio(&mut self, clip: AudioClip)

Source

pub fn play_audio_once(&mut self, name: &str)

Source

pub fn play_audio_loop(&mut self, name: &str)

Source

pub fn stop_audio(&mut self, name: &str)

Source

pub fn toggle_pause_audio(&mut self, name: &str)

Source

pub fn to_serializer(&self) -> AppStateSerializer

Source

pub fn inject_serializer( &mut self, serializer: AppStateSerializer, display: Display<WindowSurface>, additive: bool, )

Source

pub fn add_state_data(&mut self, name: &str, data: Box<dyn Any>)

Source

pub fn add_material(&mut self, material: Material)

Source

pub fn get_material(&self, uuid: &Uuid) -> Option<&Material>

Source

pub fn get_material_by_name(&self, name: &str) -> Option<&Material>

Source

pub fn get_state_data_value<T: 'static>(&self, name: &str) -> Option<&T>

Source

pub fn get_state_data_value_mut<T: 'static>( &mut self, name: &str, ) -> Option<&mut T>

Source

pub fn set_state_data_value(&mut self, name: &str, value: Box<dyn Any>)

Source

pub fn inject_gui(&mut self, function: GUIDrawFunction)

Source

pub fn add_post_process(&mut self, post_process: Box<dyn PostProcessingEffect>)

Source

pub fn get_post_processes(&self) -> &Vec<Box<dyn PostProcessingEffect>>

Source

pub fn get_post_processes_mut( &mut self, ) -> &mut Vec<Box<dyn PostProcessingEffect>>

Source

pub fn get_mouse_state(&self) -> &MouseState

Source

pub fn get_mouse_state_mut(&mut self) -> &mut MouseState

Source

pub fn convert_to_arc_mutex(self) -> Arc<Mutex<Self>>

Source

pub fn add_object(&mut self, object: Object)

Source

pub fn get_objects(&self) -> &Vec<Object>

Source

pub fn get_object(&self, name: &str) -> Option<&Object>

Source

pub fn get_object_mut(&mut self, name: &str) -> Option<&mut Object>

Source

pub fn get_object_by_uuid(&self, uuid: &Uuid) -> Option<&Object>

Source

pub fn get_object_by_uuid_mut(&mut self, uuid: Uuid) -> Option<&mut Object>

Source

pub fn get_selected_objects_mut(&mut self) -> Vec<&mut Object>

Source

pub fn add_light(&mut self, light: Light, light_type: LightEmissionType)

Source

pub fn remove_light(&mut self, index: usize, light_type: LightEmissionType)

Source

pub fn get_lights(&self) -> &Vec<Light>

Source

pub fn set_fps(&mut self, fps: u64)

Source

pub fn get_fps(&self) -> u64

Source

pub fn get_objects_mut(&mut self) -> &mut Vec<Object>

Source

pub fn set_camera(&mut self, camera: Camera)

Source

pub fn get_camera(&self) -> &Option<Camera>

Source

pub fn get_camera_mut(&mut self) -> &mut Option<Camera>

Source

pub fn set_renderscale(&mut self, scale: u32)

Source

pub fn get_renderscale(&self) -> u32

Source

pub fn set_max_buffers(&mut self, max_buffers: usize)

Source

pub fn get_max_buffers(&self) -> usize

Source

pub fn inject_event( &mut self, characteristic: EventCharacteristic, function: EventFunction, modifiers: Option<EventModifiers>, )

Source

pub fn inject_update_function(&mut self, function: EventFunction)

Source

pub fn set_skybox(&mut self, skybox: Object)

Source

pub fn set_skybox_from_texture( &mut self, texture: Texture, event_loop: &EventLoop, )

Source

pub fn get_skybox(&self) -> &Option<Object>

Source

pub fn get_skybox_mut(&mut self) -> &mut Option<Object>

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<S> FromSample<S> for S

Source§

fn from_sample_(s: S) -> S

Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> IntoEither for T

Source§

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 more
Source§

fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
where F: FnOnce(&Self) -> bool,

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 more
Source§

impl<F, T> IntoSample<T> for F
where T: FromSample<F>,

Source§

fn into_sample(self) -> T

Source§

impl<T> Pointable for T

Source§

const ALIGN: usize

The alignment of pointer.
Source§

type Init = T

The type for initializers.
Source§

unsafe fn init(init: <T as Pointable>::Init) -> usize

Initializes a with the given initializer. Read more
Source§

unsafe fn deref<'a>(ptr: usize) -> &'a T

Dereferences the given pointer. Read more
Source§

unsafe fn deref_mut<'a>(ptr: usize) -> &'a mut T

Mutably dereferences the given pointer. Read more
Source§

unsafe fn drop(ptr: usize)

Drops the object pointed to by the given pointer. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

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

Source§

fn to_subset(&self) -> Option<SS>

The inverse inclusion map: attempts to construct self from the equivalent element of its superset. Read more
Source§

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

Use with care! Same as self.to_subset but without any property checks. Always succeeds.
Source§

fn from_subset(element: &SS) -> SP

The inclusion map: converts self to the equivalent element of its superset.
Source§

impl<T, U> ToSample<U> for T
where U: FromSample<T>,

Source§

fn to_sample_(self) -> U

Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

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

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<S, T> Duplex<S> for T
where T: FromSample<S> + ToSample<S>,

Source§

impl<T> ErasedDestructor for T
where T: 'static,