pub struct World {
pub camera: Camera,
pub physics: World,
pub sounds: Sounds,
pub fx: Fx,
pub rng: Rng,
/* private fields */
}Fields§
§camera: Camera§physics: World§sounds: Sounds§fx: Fx§rng: RngImplementations§
Source§impl World
impl World
pub fn play_clip(&mut self, id: ObjectId, clip: &str) -> Result<(), AnimError>
pub fn animate(&mut self, id: ObjectId, clip: &str) -> Animate<'_>
pub fn stop_animation(&mut self, id: ObjectId) -> bool
pub fn animator(&self, id: ObjectId) -> Option<&Animator>
pub fn animator_mut(&mut self, id: ObjectId) -> Option<&mut Animator>
pub fn sprite(&self, id: ObjectId) -> Option<&SpritePlayer>
pub fn sprite_mut(&mut self, id: ObjectId) -> Option<&mut SpritePlayer>
pub fn palette(&self, id: ObjectId) -> Option<Vec<[[f32; 4]; 4]>>
pub fn sprite_frame(&self, id: ObjectId) -> Option<[f32; 4]>
pub fn animation_events(&self) -> &[AnimationEvent]
pub fn animation_errors(&self) -> &[AnimError]
pub fn posed(&self) -> Posed
Source§impl World
impl World
pub fn character(&mut self, id: ObjectId) -> Result<&mut Character, PlayError>
pub fn set_character_desc( &mut self, id: ObjectId, desc: CharacterDesc, ) -> Result<(), PlayError>
pub fn character_of(&self, id: ObjectId) -> Option<&Character>
pub fn characters(&self) -> impl Iterator<Item = (ObjectId, &Character)>
pub fn character_desc(&self, id: ObjectId) -> Option<&CharacterDesc>
pub fn remove_character(&mut self, id: ObjectId) -> bool
Source§impl World
impl World
pub fn raycast( &self, origin: [f32; 3], direction: [f32; 3], max_distance: f32, query: &Query, ) -> Result<Option<Hit>, QueryError>
pub fn shape_cast( &self, shape_of: BodyShape, at: [f32; 3], rotation: [f32; 4], direction: [f32; 3], max_distance: f32, query: &Query, ) -> Result<Option<Hit>, QueryError>
pub fn overlaps( &self, shape_of: BodyShape, at: [f32; 3], rotation: [f32; 4], query: &Query, ) -> Result<Vec<Overlap>, QueryError>
pub fn overlaps_point( &self, point: [f32; 3], query: &Query, ) -> Result<Vec<Overlap>, QueryError>
Source§impl World
impl World
pub fn rig_names(&self) -> impl Iterator<Item = &str>
pub fn rig_desc(&self, name: &str) -> Option<&RigDesc>
pub fn rig_state(&self, name: &str) -> Option<&Rig>
pub fn rig_state_mut(&mut self, name: &str) -> Option<&mut Rig>
pub fn active_rig(&self) -> Option<&str>
pub fn rig(&mut self, name: &str) -> bool
pub fn rig_off(&mut self)
pub fn rig_target(&mut self, name: &str, target: Option<&str>) -> bool
pub fn rig_look(&mut self, mouse: [f32; 2])
pub fn set_view_aspect(&mut self, aspect: f32)
pub fn rig_grounded(&mut self, grounded: bool)
Source§impl World
impl World
pub fn scene(&self) -> &Scene
pub fn len(&self) -> usize
pub fn is_empty(&self) -> bool
pub fn object(&self, name: &str) -> Option<ObjectId>
pub fn ids(&self) -> impl Iterator<Item = ObjectId>
pub fn name(&self, id: ObjectId) -> &str
pub fn parent(&self, id: ObjectId) -> Option<ObjectId>
pub fn rest(&self, id: ObjectId) -> [[f32; 4]; 4]
pub fn local(&self, id: ObjectId) -> [[f32; 4]; 4]
pub fn set_local(&mut self, id: ObjectId, local: [[f32; 4]; 4])
pub fn model(&self, id: ObjectId) -> [[f32; 4]; 4]
pub fn models(&self) -> Vec<[[f32; 4]; 4]>
pub fn set_model(&mut self, id: ObjectId, world: [[f32; 4]; 4]) -> bool
pub fn at(&self, id: ObjectId) -> [f32; 3]
pub fn place(&mut self, id: ObjectId, at: [f32; 3], rotation: [f32; 4]) -> bool
pub fn move_to(&mut self, id: ObjectId, at: [f32; 3]) -> bool
pub fn look(&self, id: ObjectId) -> &Look
pub fn set_look(&mut self, id: ObjectId, look: Look)
pub fn body(&self, id: ObjectId) -> Option<BodyId>
pub fn body_desc(&self, id: ObjectId) -> Option<&Body>
pub fn material(&self, name: &str) -> Option<Material>
pub fn edited_materials(&self) -> &BTreeMap<String, Material>
pub fn light(&self, name: &str) -> Option<&Light>
pub fn lights(&self) -> &BTreeMap<String, Light>
pub fn set_light(&mut self, name: &str, light: Light) -> bool
pub fn exposure(&self) -> f32
pub fn set_exposure(&mut self, exposure: f32) -> bool
pub fn sound_level(&self, name: &str) -> Option<SoundLevel>
pub fn tunables(&self) -> &Tunables
pub fn tunable<T>(&self, name: &str) -> Option<T>where
T: FromTunable,
pub fn set_tunable( &mut self, name: &str, value: TunableValue, ) -> Result<TunableValue, String>
pub fn contacts(&self) -> &[Contact]
pub fn ticks(&self) -> u64
pub fn time(&self) -> f64
pub fn clock(&self) -> &Clock
pub fn hit_stop(&mut self, stop: HitStop)
pub fn set_speed(&mut self, speed: f32)
pub fn state<T>(&self) -> Option<&T>where
T: Any,
pub fn state_mut<T>(&mut self) -> Option<&mut T>where
T: Any,
pub fn set_state<T>(&mut self, state: T)where
T: Any,
pub fn play_sound(&mut self, name: &str) -> bool
pub fn play_cued(&mut self, cue: Cue) -> usize
pub fn play_hits(&mut self) -> usize
pub fn pose_movers(&mut self)
pub fn set_cursor(&mut self, cursor: Cursor)
pub fn cursor(&self) -> Cursor
pub fn warp_pointer(&mut self, point: [f32; 2])
pub fn take_warp(&mut self) -> Option<[f32; 2]>
pub fn rumble(&mut self, rumble: Rumble)
pub fn rumble_pad(&mut self, pad: PadId, rumble: Rumble)
pub fn rumble_queue(&self) -> &[RumbleRequest]
pub fn events(&self) -> &[WorldEvent]
pub fn layers(&self) -> &Layers
pub fn is_trigger(&self, id: ObjectId) -> bool
pub fn inside(&self, trigger: ObjectId) -> Vec<ObjectId>
pub fn quit(&mut self, code: u8)
pub fn fail(&mut self, error: impl Display)
pub fn exit(&self) -> Option<&Exit>
pub fn display(&self) -> &DisplaySettings
pub fn audio_due(&self) -> usize
Auto Trait Implementations§
impl !Freeze for World
impl !RefUnwindSafe for World
impl !Send for World
impl !Sync for World
impl Unpin for World
impl UnsafeUnpin for World
impl !UnwindSafe for World
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
§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Convert
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>. Box<dyn Any> can
then be further downcast into Box<ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Convert
Rc<Trait> (where Trait: Downcast) to Rc<Any>. Rc<Any> can then be
further downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Convert
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Convert
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<T> Downcast for Twhere
T: Any,
impl<T> Downcast for Twhere
T: Any,
§fn into_any(self: Box<T>) -> Box<dyn Any>
fn into_any(self: Box<T>) -> Box<dyn Any>
Converts
Box<dyn Trait> (where Trait: Downcast) to Box<dyn Any>, which can then be
downcast into Box<dyn ConcreteType> where ConcreteType implements Trait.§fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
fn into_any_rc(self: Rc<T>) -> Rc<dyn Any>
Converts
Rc<Trait> (where Trait: Downcast) to Rc<Any>, which can then be further
downcast into Rc<ConcreteType> where ConcreteType implements Trait.§fn as_any(&self) -> &(dyn Any + 'static)
fn as_any(&self) -> &(dyn Any + 'static)
Converts
&Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &Any’s vtable from &Trait’s.§fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
fn as_any_mut(&mut self) -> &mut (dyn Any + 'static)
Converts
&mut Trait (where Trait: Downcast) to &Any. This is needed since Rust cannot
generate &mut Any’s vtable from &mut Trait’s.§impl<S> FromSample<S> for S
impl<S> FromSample<S> for S
fn from_sample_(s: S) -> S
§impl<T> Instrument for T
impl<T> Instrument for T
§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
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 more§impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
impl<F, T, S> SimdInto<T, S> for Fwhere
T: SimdFrom<F, S>,
S: Simd,
§impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
impl<SS, SP> SupersetOf<SS> for SPwhere
SS: SubsetOf<SP>,
§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 more§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).§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.§fn from_subset(element: &SS) -> SP
fn from_subset(element: &SS) -> SP
The inclusion map: converts
self to the equivalent element of its superset.