use na::{Scalar, Real, U1, U2, U3, U4}; use aliases::{Vec, Mat, Qua}; /// Creates a new 1D vector. pub fn vec1(x: N) -> Vec { Vec::::new(x) } /// Creates a new 2D vector. pub fn vec2(x: N, y: N) -> Vec { Vec::::new(x, y) } /// Creates a new 3D vector. pub fn vec3(x: N, y: N, z: N) -> Vec { Vec::::new(x, y, z) } /// Creates a new 4D vector. pub fn vec4(x: N, y: N, z: N, w: N) -> Vec { Vec::::new(x, y, z, w) } /// Create a new 2x2 matrix. pub fn mat2(m11: N, m12: N, m21: N, m22: N) -> Mat { Mat::::new( m11, m12, m21, m22, ) } /// Create a new 2x2 matrix. pub fn mat2x2(m11: N, m12: N, m21: N, m22: N) -> Mat { Mat::::new( m11, m12, m21, m22, ) } /// Create a new 2x3 matrix. pub fn mat2x3(m11: N, m12: N, m13: N, m21: N, m22: N, m23: N) -> Mat { Mat::::new( m11, m12, m13, m21, m22, m23, ) } /// Create a new 2x4 matrix. pub fn mat2x4(m11: N, m12: N, m13: N, m14: N, m21: N, m22: N, m23: N, m24: N) -> Mat { Mat::::new( m11, m12, m13, m14, m21, m22, m23, m24, ) } /// Create a new 3x3 matrix. pub fn mat3(m11: N, m12: N, m13: N, m21: N, m22: N, m23: N, m31: N, m32: N, m33: N) -> Mat { Mat::::new( m11, m12, m13, m21, m22, m23, m31, m32, m33, ) } /// Create a new 3x2 matrix. pub fn mat3x2(m11: N, m12: N, m21: N, m22: N, m31: N, m32: N) -> Mat { Mat::::new( m11, m12, m21, m22, m31, m32, ) } /// Create a new 3x3 matrix. pub fn mat3x3(m11: N, m12: N, m13: N, m21: N, m22: N, m23: N, m31: N, m32: N, m33: N) -> Mat { Mat::::new( m11, m12, m13, m31, m32, m33, m21, m22, m23, ) } /// Create a new 3x4 matrix. pub fn mat3x4(m11: N, m12: N, m13: N, m14: N, m21: N, m22: N, m23: N, m24: N, m31: N, m32: N, m33: N, m34: N) -> Mat { Mat::::new( m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, ) } /// Create a new 4x2 matrix. pub fn mat4x2(m11: N, m12: N, m21: N, m22: N, m31: N, m32: N, m41: N, m42: N) -> Mat { Mat::::new( m11, m12, m21, m22, m31, m32, m41, m42, ) } /// Create a new 4x3 matrix. pub fn mat4x3(m11: N, m12: N, m13: N, m21: N, m22: N, m23: N, m31: N, m32: N, m33: N, m41: N, m42: N, m43: N) -> Mat { Mat::::new( m11, m12, m13, m21, m22, m23, m31, m32, m33, m41, m42, m43, ) } /// Create a new 4x4 matrix. pub fn mat4x4(m11: N, m12: N, m13: N, m14: N, m21: N, m22: N, m23: N, m24: N, m31: N, m32: N, m33: N, m34: N, m41: N, m42: N, m43: N, m44: N) -> Mat { Mat::::new( m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44, ) } /// Create a new 4x4 matrix. pub fn mat4(m11: N, m12: N, m13: N, m14: N, m21: N, m22: N, m23: N, m24: N, m31: N, m32: N, m33: N, m34: N, m41: N, m42: N, m43: N, m44: N) -> Mat { Mat::::new( m11, m12, m13, m14, m21, m22, m23, m24, m31, m32, m33, m34, m41, m42, m43, m44, ) } /// Creates a new quaternion. pub fn quat(x: N, y: N, z: N, w: N) -> Qua { Qua::new(x, y, z, w) }