plasma-prp 0.1.0

Read, write, inspect, and manipulate Plasma engine PRP files used by Myst Online: Uru Live
Documentation
//! plAGMasterMod — manages animation instances with blend weights.
//!
//! C++ ref: plAnimation/plAGMasterMod.h/.cpp, plAGModifier.h/.cpp, plAGAnimInstance.h/.cpp

use crate::core::uoid::Uoid;

/// A running animation instance attached to a master mod.
#[derive(Debug, Clone)]
pub struct AGAnimInstance {
    pub anim_key: Uoid,
    pub anim_name: String,
    pub blend_weight: f32,
    pub speed: f32,
    pub current_time: f32,
    pub is_attached: bool,
}

impl Default for AGAnimInstance {
    fn default() -> Self {
        Self {
            anim_key: Uoid::invalid(),
            anim_name: String::new(),
            blend_weight: 1.0,
            speed: 1.0,
            current_time: 0.0,
            is_attached: false,
        }
    }
}

/// Parsed plAGMasterMod data.
#[derive(Debug, Clone)]
pub struct AGMasterModData {
    pub self_key: Option<Uoid>,
    pub group_name: String,
    pub is_grouped: bool,
    pub is_grouped_master: bool,
    /// Private animation keys.
    pub private_anims: Vec<Uoid>,
}

impl Default for AGMasterModData {
    fn default() -> Self {
        Self {
            self_key: None,
            group_name: String::new(),
            is_grouped: false,
            is_grouped_master: false,
            private_anims: Vec::new(),
        }
    }
}

/// Parsed plAGModifier data — per-channel target.
#[derive(Debug, Clone)]
pub struct AGModifierData {
    pub self_key: Option<Uoid>,
    pub channel_name: String,
    pub auto_apply: bool,
    pub enabled: bool,
}

impl Default for AGModifierData {
    fn default() -> Self {
        Self {
            self_key: None,
            channel_name: String::new(),
            auto_apply: true,
            enabled: true,
        }
    }
}