vec4g

Macro vec4g 

Source
macro_rules! vec4g {
    ($($arg:expr),* $(,)?) => { ... };
}
Expand description

Creates a vector4 from four elements, where type inference determines if it is [Simd] or [NonSimd].

Also accepts vectors as arguments, as long as they contain exactly four elements in total. If only a single element is provided, it will be repeated across all elements.

ยงExamples

use ggmath::{Vec4, Vec4S, vec2g, vec4g};

let v: Vec4<f32> = vec4g!(1.0, 2.0, 3.0, 4.0);
let v: Vec4<f32> = vec4g!(1.0, vec2g!(2.0, 3.0), 4.0);
let v: Vec4<f32> = vec4g!(1.0);

let v: Vec4S<f32> = vec4g!(1.0, 2.0, 3.0, 4.0);
let v: Vec4S<f32> = vec4g!(1.0, vec2g!(2.0, 3.0), 4.0);
let v: Vec4S<f32> = vec4g!(1.0);