use actix::Message;
use benthic_default_asset_converter::generated::DEFAULT_SKELETON;
use benthic_protocol::skeleton::{JointName, Skeleton};
use glam::Vec3;
use serde::{Deserialize, Serialize};
use std::collections::BTreeSet;
use std::path::PathBuf;
use std::time::SystemTime;
use uuid::Uuid;
#[derive(Debug, Clone, Message, Serialize, Deserialize)]
#[rtype(result = "()")]
pub struct Avatar {
pub agent_id: Uuid,
pub items: Vec<OutfitObject>,
pub position: Vec3,
pub skeleton: Skeleton,
pub path: Option<PathBuf>,
pub used_joints: BTreeSet<JointName>,
pub fully_loaded: bool,
pub outfit_size: usize,
pub last_update: SystemTime,
}
impl Avatar {
pub fn new(agent_id: Uuid, position: Vec3) -> Self {
Avatar {
agent_id,
position,
items: Vec::new(),
skeleton: DEFAULT_SKELETON.clone(),
path: None,
last_update: SystemTime::now(),
outfit_size: 0,
fully_loaded: false,
used_joints: BTreeSet::new(),
}
}
}
#[derive(Debug, Clone, Serialize, Deserialize)]
pub enum OutfitObject {
MeshObject(PathBuf),
Bodypart,
Clothing,
Other,
}