feat: add helios to etherdream transformer
This commit is contained in:
parent
ff96bdf6fa
commit
3ce346306f
3 changed files with 33 additions and 1 deletions
27
src/transformer/helios_to_etherdream.rs
Normal file
27
src/transformer/helios_to_etherdream.rs
Normal file
|
|
@ -0,0 +1,27 @@
|
|||
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)]
|
||||
pub struct HeliosToEtherdream {
|
||||
}
|
||||
|
||||
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 {
|
||||
x: 8.0 * (pt.x - 2047.0),
|
||||
y: 8.0 * (pt.y - 2047.0),
|
||||
..*pt
|
||||
}
|
||||
}).collect();
|
||||
// debug!("list etherdream {:?}", out);
|
||||
out
|
||||
}
|
||||
}
|
||||
|
||||
Loading…
Add table
Add a link
Reference in a new issue