pub struct PresenceState { /* private fields */ }Expand description
All travelers currently present in the world.
Implementations§
Source§impl PresenceState
impl PresenceState
pub fn new() -> Self
pub fn count(&self) -> usize
pub fn is_empty(&self) -> bool
Sourcepub fn join(&mut self, id: u32, name: impl Into<String>, color: [f32; 4])
pub fn join(&mut self, id: u32, name: impl Into<String>, color: [f32; 4])
A traveler joined (or re-announced). Idempotent.
Sourcepub fn restyle(
&mut self,
id: u32,
name: Option<String>,
color: Option<[f32; 4]>,
)
pub fn restyle( &mut self, id: u32, name: Option<String>, color: Option<[f32; 4]>, )
Upgrade a traveler’s look once their identity resolves (e.g. a Passport
descriptor arrived): each Some replaces the placeholder. No-op for
unknown ids.
Sourcepub fn set_avatar(&mut self, id: u32, avatar: Option<AvatarSpec>)
pub fn set_avatar(&mut self, id: u32, avatar: Option<AvatarSpec>)
Attach a traveler’s portable avatar (from their Passport descriptor).
Sourcepub fn pose(&mut self, id: u32, sample: PoseSample)
pub fn pose(&mut self, id: u32, sample: PoseSample)
Record a pose for a traveler (auto-joins with a default look if unknown).
Sourcepub fn entities(&self, now_ms: u64, foot_lift: f32) -> Vec<Instance>
pub fn entities(&self, now_ms: u64, foot_lift: f32) -> Vec<Instance>
Every traveler as a drawable Instance, interpolated at now_ms.
foot_lift raises a centered capsule so its feet meet the ground
(match the player).
Sourcepub fn poses(&self, now_ms: u64, foot_lift: f32) -> Vec<TravelerPose>
pub fn poses(&self, now_ms: u64, foot_lift: f32) -> Vec<TravelerPose>
Every traveler’s interpolated pose at now_ms — what the skinned
character path consumes; Self::entities is the flat capsule view.
Trait Implementations§
Auto Trait Implementations§
impl Freeze for PresenceState
impl RefUnwindSafe for PresenceState
impl Send for PresenceState
impl Sync for PresenceState
impl Unpin for PresenceState
impl UnsafeUnpin for PresenceState
impl UnwindSafe for PresenceState
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