use crate::vrm::gltf::materials::VrmcMaterialsExtensitions;
use bevy::math::Vec2;
use bevy::prelude::*;
#[derive(Debug, Clone, Copy, PartialEq, Reflect)]
pub struct UVAnimation {
pub rotation_speed: f32,
pub scroll_speed: Vec2,
}
impl From<&VrmcMaterialsExtensitions> for UVAnimation {
fn from(extension: &VrmcMaterialsExtensitions) -> Self {
Self {
rotation_speed: extension.uv_animation_rotation_speed_factor,
scroll_speed: Vec2::new(
extension.uv_animation_scroll_x_speed_factor,
extension.uv_animation_scroll_y_speed_factor,
),
}
}
}
impl Default for UVAnimation {
fn default() -> Self {
Self {
rotation_speed: 0.0,
scroll_speed: Vec2::ZERO,
}
}
}