macro_rules! vec3 {
($($e:expr),*) => { ... };
}Expand description
Macro for creating a 3D vector (Vec3) using a concise syntax.
§Syntax
The vec3! macro accepts a comma-separated list of values, representing the elements of
a 3D vector. It constructs a Vec3 instance using the provided values.
§Examples
let vec = vec3![1.0, 2.0, 3.0];
assert_eq!(vec.to_arr(), &[1.0, 2.0, 3.0]);§Notes
- The macro internally uses the
from_arrayfunction to create the vector. - Ensure that the provided expressions are suitable for initializing a 3D vector.
- The resulting
Vec3struct will be created using thefrom_arrayfunction.
§See Also
Vec3: The 3D vector type used by this macro.from_array: Function to construct a vector from an array.