macro_rules! vec2 {
($($arg:expr),*$(,)?) => { ... };
}Expand description
Creates a 2-dimensional vector from the provided arguments.
The macro accepts scalars and vectors as arguments, as long as they can be combined to form a 2-component vector. If only a single scalar argument is provided, it is duplicated across all components.
ยงExamples
use ggmath::{Vec2, vec2};
let one_two: Vec2<f32> = vec2!(1.0, 2.0);
let one_two: Vec2<f32> = vec2!(vec2!(1.0, 2.0));
let one_one: Vec2<f32> = vec2!(1.0);