| use crate::Ctx; | |
| use dyn_any::DynAny; | |
| use glam::{DVec2, IVec2, UVec2}; | |
| /// Obtains the X or Y component of a coordinate point. | |
| /// | |
| /// The inverse of this node is "Coordinate Value", which can have either or both its X and Y exposed as graph inputs. | |
| fn extract_xy<T: Into<DVec2>>(_: impl Ctx, vector: T, axis: XY) -> f64 { | |
| match axis { | |
| XY::X => vector.into().x, | |
| XY::Y => vector.into().y, | |
| } | |
| } | |
| /// The X or Y component of a coordinate. | |
| pub enum XY { | |
| X, | |
| Y, | |
| } | |