From e2cfe36b9d07ea7e6861f715e119c249dfbab4bc Mon Sep 17 00:00:00 2001 From: Brendan Zabarauskas Date: Tue, 6 Nov 2012 12:23:06 +1000 Subject: [PATCH] Make type aliases public --- src/matrix.rs | 48 +++++++++++++++++++++++------------------------ src/quaternion.rs | 4 ++-- src/vector.rs | 30 ++++++++++++++--------------- 3 files changed, 41 insertions(+), 41 deletions(-) diff --git a/src/matrix.rs b/src/matrix.rs index 28711cb..ac5cab1 100644 --- a/src/matrix.rs +++ b/src/matrix.rs @@ -14,31 +14,31 @@ use vector::{Vec2, Vec3, Vec4}; // GLSL equivalent type aliases -type mat2 = Mat2; /// a 2×2 single-precision floating-point matrix -type mat3 = Mat3; /// a 3×3 single-precision floating-point matrix -type mat4 = Mat4; /// a 4×4 single-precision floating-point matrix -type mat2x2 = Mat2; /// same as a `mat2` -// type mat2x3 = /// a single-precision floating-point matrix with 2 columns and 3 rows -// type mat2x4 = /// a single-precision floating-point matrix with 2 columns and 4 rows -// type mat3x2 = /// a single-precision floating-point matrix with 3 columns and 2 rows -type mat3x3 = Mat3; /// same as a `mat3` -// type mat3x4 = /// a single-precision floating-point matrix with 3 columns and 4 rows -// type mat4x2 = /// a single-precision floating-point matrix with 4 columns and 2 rows -// type mat4x3 = /// a single-precision floating-point matrix with 4 columns and 3 rows -type mat4x4 = Mat4; /// same as a `mat4` +pub type mat2 = Mat2; /// a 2×2 single-precision floating-point matrix +pub type mat3 = Mat3; /// a 3×3 single-precision floating-point matrix +pub type mat4 = Mat4; /// a 4×4 single-precision floating-point matrix +pub type mat2x2 = Mat2; /// same as a `mat2` +// pub type mat2x3 = /// a single-precision floating-point matrix with 2 columns and 3 rows +// pub type mat2x4 = /// a single-precision floating-point matrix with 2 columns and 4 rows +// pub type mat3x2 = /// a single-precision floating-point matrix with 3 columns and 2 rows +pub type mat3x3 = Mat3; /// same as a `mat3` +// pub type mat3x4 = /// a single-precision floating-point matrix with 3 columns and 4 rows +// pub type mat4x2 = /// a single-precision floating-point matrix with 4 columns and 2 rows +// pub type mat4x3 = /// a single-precision floating-point matrix with 4 columns and 3 rows +pub type mat4x4 = Mat4; /// same as a `mat4` -type dmat2 = Mat2; /// a 2×2 double-precision floating-point matrix -type dmat3 = Mat3; /// a 3×3 double-precision floating-point matrix -type dmat4 = Mat4; /// a 4×4 double-precision floating-point matrix -type dmat2x2 = Mat2; /// same as a `dmat2` -// type dmat2x3 = /// a double-precision floating-point matrix with 2 columns and 3 rows -// type dmat2x4 = /// a double-precision floating-point matrix with 2 columns and 4 rows -// type dmat3x2 = /// a double-precision floating-point matrix with 3 columns and 2 rows -type dmat3x3 = Mat3; /// same as a `dmat3` -// type dmat3x4 = /// a double-precision floating-point matrix with 3 columns and 4 rows -// type dmat4x2 = /// a double-precision floating-point matrix with 4 columns and 2 rows -// type dmat4x3 = /// a double-precision floating-point matrix with 4 columns and 3 rows -type dmat4x4 = Mat4; /// same as a `dmat4` +pub type dmat2 = Mat2; /// a 2×2 double-precision floating-point matrix +pub type dmat3 = Mat3; /// a 3×3 double-precision floating-point matrix +pub type dmat4 = Mat4; /// a 4×4 double-precision floating-point matrix +pub type dmat2x2 = Mat2; /// same as a `dmat2` +// pub type dmat2x3 = /// a double-precision floating-point matrix with 2 columns and 3 rows +// pub type dmat2x4 = /// a double-precision floating-point matrix with 2 columns and 4 rows +// pub type dmat3x2 = /// a double-precision floating-point matrix with 3 columns and 2 rows +pub type dmat3x3 = Mat3; /// same as a `dmat3` +// pub type dmat3x4 = /// a double-precision floating-point matrix with 3 columns and 4 rows +// pub type dmat4x2 = /// a double-precision floating-point matrix with 4 columns and 2 rows +// pub type dmat4x3 = /// a double-precision floating-point matrix with 4 columns and 3 rows +pub type dmat4x4 = Mat4; /// same as a `dmat4` pub trait Matrix { diff --git a/src/quaternion.rs b/src/quaternion.rs index 981d284..046a179 100644 --- a/src/quaternion.rs +++ b/src/quaternion.rs @@ -15,8 +15,8 @@ use vector::Vec3; // These quaternion type aliases are not actually specified in the GLSL spec // but they follow the same nomenclature -type quat4 = Quat; /// a single-precision floating-point quaternion -type dquat4 = Quat; /// a double-precision floating-point quaternion +pub type quat4 = Quat; /// a single-precision floating-point quaternion +pub type dquat4 = Quat; /// a double-precision floating-point quaternion // // Quaternion diff --git a/src/vector.rs b/src/vector.rs index e1f3289..7d60b96 100644 --- a/src/vector.rs +++ b/src/vector.rs @@ -11,25 +11,25 @@ use math::*; // GLSL equivalent type aliases -type vec2 = Vec2; /// a two-component single-precision floating-point vector -type vec3 = Vec3; /// a three-component single-precision floating-point vector -type vec4 = Vec4; /// a four-component single-precision floating-point vector +pub type vec2 = Vec2; /// a two-component single-precision floating-point vector +pub type vec3 = Vec3; /// a three-component single-precision floating-point vector +pub type vec4 = Vec4; /// a four-component single-precision floating-point vector -type dvec2 = Vec2; /// a two-component double-precision floating-point vector -type dvec3 = Vec3; /// a three-component double-precision floating-point vector -type dvec4 = Vec4; /// a four-component double-precision floating-point vector +pub type dvec2 = Vec2; /// a two-component double-precision floating-point vector +pub type dvec3 = Vec3; /// a three-component double-precision floating-point vector +pub type dvec4 = Vec4; /// a four-component double-precision floating-point vector -type bvec2 = Vec2; /// a two-component Boolean vector -type bvec3 = Vec3; /// a three-component Boolean vector -type bvec4 = Vec4; /// a four-component Boolean vector +pub type bvec2 = Vec2; /// a two-component Boolean vector +pub type bvec3 = Vec3; /// a three-component Boolean vector +pub type bvec4 = Vec4; /// a four-component Boolean vector -type ivec2 = Vec2; /// a two-component signed integer vector -type ivec3 = Vec3; /// a three-component signed integer vector -type ivec4 = Vec4; /// a four-component signed integer vector +pub type ivec2 = Vec2; /// a two-component signed integer vector +pub type ivec3 = Vec3; /// a three-component signed integer vector +pub type ivec4 = Vec4; /// a four-component signed integer vector -type uvec2 = Vec2; /// a two-component unsigned integer vector -type uvec3 = Vec3; /// a three-component unsigned integer vector -type uvec4 = Vec4; /// a four-component unsigned integer vector +pub type uvec2 = Vec2; /// a two-component unsigned integer vector +pub type uvec3 = Vec3; /// a three-component unsigned integer vector +pub type uvec4 = Vec4; /// a four-component unsigned integer vector pub trait Vector {