diff --git a/src/mat2.rs b/src/mat2.rs index b74a688..00be834 100644 --- a/src/mat2.rs +++ b/src/mat2.rs @@ -108,22 +108,13 @@ pub impl Mat2 { sin_theta, cos_theta) } - // FIXME: An interim solution to the issues with static functions + /// Wrapper method for `Matrix::identity` #[inline(always)] - static pure fn identity() -> Mat2 { - let _0 = Number::from(0); - let _1 = Number::from(1); - Mat2::new(_1, _0, - _0, _1) - } + static pure fn identity() -> Mat2 { Matrix::identity() } - // FIXME: An interim solution to the issues with static functions + /// Wrapper method for `Matrix::zero` #[inline(always)] - static pure fn zero() -> Mat2 { - let _0 = Number::from(0); - Mat2::new(_0, _0, - _0, _0) - } + static pure fn zero() -> Mat2 { Matrix::zero() } } pub impl Mat2: Matrix> { diff --git a/src/mat3.rs b/src/mat3.rs index d51d113..612a262 100644 --- a/src/mat3.rs +++ b/src/mat3.rs @@ -112,24 +112,13 @@ pub impl Mat3 { _0, _0, value) } - // FIXME: An interim solution to the issues with static functions + /// Wrapper method for `Matrix::identity` #[inline(always)] - static pure fn identity() -> Mat3 { - let _0 = Number::from(0); - let _1 = Number::from(1); - Mat3::new(_1, _0, _0, - _0, _1, _0, - _0, _0, _1) - } + static pure fn identity() -> Mat3 { Matrix::identity() } - // FIXME: An interim solution to the issues with static functions + /// Wrapper method for `Matrix::zero` #[inline(always)] - static pure fn zero() -> Mat3 { - let _0 = Number::from(0); - Mat3::new(_0, _0, _0, - _0, _0, _0, - _0, _0, _0) - } + static pure fn zero() -> Mat3 { Matrix::zero() } /** * Construct a matrix from an angular rotation around the `x` axis diff --git a/src/mat4.rs b/src/mat4.rs index 5e5e696..15ff6ad 100644 --- a/src/mat4.rs +++ b/src/mat4.rs @@ -123,26 +123,13 @@ pub impl Mat4 { _0, _0, _0, value) } - // FIXME: An interim solution to the issues with static functions + /// Wrapper method for `Matrix::identity` #[inline(always)] - static pure fn identity() -> Mat4 { - let _0 = Number::from(0); - let _1 = Number::from(1); - Mat4::new(_1, _0, _0, _0, - _0, _1, _0, _0, - _0, _0, _1, _0, - _0, _0, _0, _1) - } + static pure fn identity() -> Mat4 { Matrix::identity() } - // FIXME: An interim solution to the issues with static functions + /// Wrapper method for `Matrix::zero` #[inline(always)] - static pure fn zero() -> Mat4 { - let _0 = Number::from(0); - Mat4::new(_0, _0, _0, _0, - _0, _0, _0, _0, - _0, _0, _0, _0, - _0, _0, _0, _0) - } + static pure fn zero() -> Mat4 { Matrix::zero() } } pub impl Mat4: Matrix> {