2023-07-24 15:29:33 +00:00
|
|
|
use crate::transformer::Transformers;
|
|
|
|
use crate::point::Point;
|
|
|
|
use crate::worldstate::WorldState;
|
|
|
|
|
|
|
|
use serde::{Serialize, Deserialize};
|
|
|
|
|
|
|
|
/// Converts helios Geometry to Helios
|
|
|
|
#[allow(dead_code)]
|
|
|
|
#[derive(Serialize, Deserialize, Debug, Clone, Copy)]
|
2023-08-05 17:11:33 +00:00
|
|
|
pub struct HeliosToEtherdream {}
|
2023-07-24 15:29:33 +00:00
|
|
|
|
|
|
|
impl Transformers for HeliosToEtherdream {
|
|
|
|
fn apply(&self, point_list: &[Point], _ws: &WorldState) -> Vec<Point> {
|
|
|
|
// debug!("list helios {:?}", point_list);
|
|
|
|
let out = point_list.iter().map(|pt| {
|
|
|
|
Point {
|
2023-08-05 17:11:33 +00:00
|
|
|
x: 50.0 * (320.0 - pt.x),
|
|
|
|
y: 40.0 * (240.0 - pt.y),
|
2023-07-24 15:29:33 +00:00
|
|
|
..*pt
|
|
|
|
}
|
|
|
|
}).collect();
|
|
|
|
// debug!("list etherdream {:?}", out);
|
|
|
|
out
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|