use crate::loaders::mesh::InstanceData;
use std::rc::Rc;
use wgpu::Buffer;

pub struct TreeInstancesComponent
{
    pub instances: Vec<InstanceData>,
    pub dissolve_amounts: Vec<f32>,
    pub dissolve_targets: Vec<f32>,
    pub transition_speed: f32,
    pub instance_buffer: Rc<Buffer>,
}

impl TreeInstancesComponent
{
    pub fn new(instances: Vec<InstanceData>, instance_buffer: Rc<Buffer>) -> Self
    {
        let num_instances = instances.len();
        Self {
            instances,
            dissolve_amounts: vec![0.0; num_instances],
            dissolve_targets: vec![0.0; num_instances],
            transition_speed: 5.0,
            instance_buffer,
        }
    }
}
