Sigil documentation
ReferenceRust referencesigil-nova

sigil-nova · avatar

Source declarations, signatures and documentation for avatar.

Source: sigil/node/sigil-nova/src/avatar.rs. SHA-256: ee8352dcb2778d7ab2357aa9a7e5094e82d162873ae8e498373b8f521663dbeb.

This reference follows declared source modules, retains conditional attributes, and includes public declarations and implementation methods. Private-module re-exports and trait resolution require the compiler; this is a source reference, not a claim that every listed item is a root import. Function bodies and constant values are omitted.

avatar::AvatarId

Unique avatar identifier.

#[derive(Debug, Clone, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub struct AvatarId(pub String);

Source line: 16.

avatar::Rotation

Euler rotation for avatar orientation.

#[derive(Debug, Clone, Copy, PartialEq, Serialize, Deserialize)]
pub struct Rotation {
/// Rotation around the Y axis (left-right look).

pub yaw: f32,
/// Rotation around the X axis (up-down look).

pub pitch: f32,
/// Rotation around the Z axis (tilt).

pub roll: f32
}

Source line: 20.

avatar::AnimationState

Animation state of an avatar.

#[derive(Debug, Clone, PartialEq, Eq, Serialize, Deserialize)]
pub enum AnimationState {
    Idle,
    Walking,
    Running,
    Sitting,
    Gesture(String),
    Custom(String),
}

Source line: 31.

avatar::PresenceStatus

Presence status of an avatar's owner.

#[derive(Debug, Clone, Copy, PartialEq, Eq, Hash, Serialize, Deserialize)]
pub enum PresenceStatus {
    Online,
    Away,
    Busy,
    Offline,
}

Source line: 42.

avatar::AvatarRecord

On-chain record of a spawned avatar.

#[derive(Debug, Clone, PartialEq, Serialize, Deserialize)]
pub struct AvatarRecord {
pub id: AvatarId,
pub owner_did: String,
pub avatar_asset_did: String,
pub position: WorldPosition,
pub rotation: Rotation,
pub animation_state: AnimationState,
pub presence: PresenceStatus,
pub world_id: WorldId,
pub last_updated: u64
}

Source line: 51.

avatar::AvatarRegistry

On-chain registry of all spawned avatars.

#[derive(Debug, Clone, Default)]
pub struct AvatarRegistry {

}

Source line: 65.

avatar::AvatarRegistry::new

Create an empty avatar registry.

pub fn new() -> Self;

Source line: 72.

avatar::AvatarRegistry::spawn_avatar

Spawn a new avatar for an agent/human.

Each DID may only have one active avatar at a time.

pub fn spawn_avatar(
        &mut self,
        owner_did: &str,
        asset_did: &str,
        position: WorldPosition,
        world_id: WorldId,
        timestamp: u64,
    ) -> Result<AvatarRecord, NovaError>;

Source line: 79.

avatar::AvatarRegistry::update_position

Update the position and rotation of an avatar.

pub fn update_position(
        &mut self,
        avatar_id: &AvatarId,
        position: WorldPosition,
        rotation: Rotation,
        timestamp: u64,
    ) -> Result<(), NovaError>;

Source line: 114.

avatar::AvatarRegistry::update_animation

Update the animation state of an avatar.

pub fn update_animation(
        &mut self,
        avatar_id: &AvatarId,
        state: AnimationState,
        timestamp: u64,
    ) -> Result<(), NovaError>;

Source line: 132.

avatar::AvatarRegistry::set_presence

Set the presence status of an avatar.

pub fn set_presence(
        &mut self,
        avatar_id: &AvatarId,
        status: PresenceStatus,
        timestamp: u64,
    ) -> Result<(), NovaError>;

Source line: 148.

avatar::AvatarRegistry::despawn_avatar

Remove an avatar from the world.

pub fn despawn_avatar(&mut self, avatar_id: &AvatarId) -> Result<AvatarRecord, NovaError>;

Source line: 164.

avatar::AvatarRegistry::get_nearby_avatars

Find all avatars within a given radius of a position.

pub fn get_nearby_avatars(&self, position: &WorldPosition, radius: f64) -> Vec<&AvatarRecord>;

Source line: 174.

avatar::AvatarRegistry::get_avatar_by_did

Look up an avatar by its owner DID.

pub fn get_avatar_by_did(&self, owner_did: &str) -> Option<&AvatarRecord>;

Source line: 188.

avatar::AvatarRegistry::get_avatar

Get an avatar by its ID.

pub fn get_avatar(&self, avatar_id: &AvatarId) -> Option<&AvatarRecord>;

Source line: 195.

avatar::AvatarRegistry::avatar_count

Total number of spawned avatars.

pub fn avatar_count(&self) -> usize;

Source line: 200.

On this page