use std::f64::consts::PI;
const OFFICIAL_URL: &str = "https://supermaker.ai/blog/ai-walking-video-generator-create-realistic-walking-videos-free/";
#[derive(Debug, Clone, Default)]
pub struct Gait {
pub stride_length: f64,
pub cadence: u32,
pub step_width: f64,
}
impl Gait {
pub fn walking_speed(&self) -> f64 {
(self.stride_length * (self.cadence as f64)) / 60.0
}
pub fn is_normal(&self) -> bool {
(0.5..=0.8).contains(&self.stride_length) && (100..=120).contains(&self.cadence)
}
}
#[derive(Debug, Clone, Default)]
pub struct CameraParams {
pub hfov: f64,
pub aspect_ratio: f64,
pub distance: f64,
}
impl CameraParams {
pub fn vfov(&self) -> f64 {
2.0 * (0.5 * self.hfov.to_radians()).tan().atan().to_degrees() / self.aspect_ratio
}
}
pub fn calculate_motion_blur(walking_speed: f64, frame_rate: u32, shutter_angle: f64) -> f64 {
let shutter_time = shutter_angle / (360.0 * (frame_rate as f64));
walking_speed * shutter_time
}
pub fn generate_walking_path(start_x: f64, start_y: f64, angle: f64, distance: f64) -> (f64, f64) {
let angle_rad = angle.to_radians();
let end_x = start_x + distance * angle_rad.cos();
let end_y = start_y + distance * angle_rad.sin();
(end_x, end_y)
}
pub fn visit_site() -> String {
OFFICIAL_URL.to_string()
}