Fix capitalization of matrix conversion methods

This commit is contained in:
Brendan Zabarauskas 2012-11-22 10:36:33 +10:00
parent 457ab80623
commit bb63eb39b5
4 changed files with 15 additions and 15 deletions

View file

@ -16,5 +16,5 @@ pub pure fn mat3_from_rotation<T:Copy Num NumCast AngleConv Trig>(theta: T, axis
}
pub pure fn mat4_from_rotation<T:Copy Num NumCast AngleConv Trig>(theta: T, axis: Vec3<T>) -> Mat4<T> {
mat3_from_rotation(theta, axis).to_Mat4()
mat3_from_rotation(theta, axis).to_mat4()
}

View file

@ -115,8 +115,8 @@ pub trait NumericMatrix2x2<T, ColRow2>: Matrix2x2<T, ColRow2>,
NumericMatrixNxN<T, ColRow2> {
// static pure fn from_value(value: T) -> self;
pure fn to_Mat3() -> Mat3<T>;
pure fn to_Mat4() -> Mat4<T>;
pure fn to_mat3() -> Mat3<T>;
pure fn to_mat4() -> Mat4<T>;
}
/// A 3 x 3 square matrix with numeric elements
@ -124,7 +124,7 @@ pub trait NumericMatrix3x3<T, ColRow3>: Matrix3x3<T, ColRow3>,
NumericMatrixNxN<T, ColRow3> {
// static pure fn from_value(value: T) -> self;
pure fn to_Mat4() -> Mat4<T>;
pure fn to_mat4() -> Mat4<T>;
}
/// A 4 x 4 square matrix with numeric elements
@ -310,12 +310,12 @@ pub impl<T:Copy Num NumCast DefaultEq> Mat2<T>: NumericMatrixNxN<T, Vec2<T>> {
pub impl<T:Copy NumCast> Mat2<T>: NumericMatrix2x2<T, Vec2<T>> {
#[inline(always)]
pure fn to_Mat3() -> Mat3<T> {
pure fn to_mat3() -> Mat3<T> {
Mat3::from_Mat2(&self)
}
#[inline(always)]
pure fn to_Mat4() -> Mat4<T> {
pure fn to_mat4() -> Mat4<T> {
Mat4::from_Mat2(&self)
}
}
@ -561,7 +561,7 @@ pub impl<T:Copy Num NumCast DefaultEq> Mat3<T>: NumericMatrixNxN<T, Vec3<T>> {
pub impl<T:Copy NumCast> Mat3<T>: NumericMatrix3x3<T, Vec3<T>> {
#[inline(always)]
pure fn to_Mat4() -> Mat4<T> {
pure fn to_mat4() -> Mat4<T> {
Mat4::from_Mat3(&self)
}
}

View file

@ -42,8 +42,8 @@ pub trait Quaternion<T>: Dimensional<T>, Eq, DefaultEq, Neg<self> {
pure fn nlerp(other: &self, amount: T) -> self;
pure fn slerp(other: &self, amount: T) -> self;
pure fn to_Mat3() -> Mat3<T>;
pure fn to_Mat4() -> Mat4<T>;
pure fn to_mat3() -> Mat3<T>;
pure fn to_mat4() -> Mat4<T>;
}
pub trait ToQuat<T> {
@ -224,7 +224,7 @@ pub impl<T:Copy Num NumCast Trig Exp Extent Ord AngleConv> Quat<T>: Quaternion<T
}
#[inline(always)]
pure fn to_Mat3() -> Mat3<T> {
pure fn to_mat3() -> Mat3<T> {
let x2 = self.v.x + self.v.x;
let y2 = self.v.y + self.v.y;
let z2 = self.v.z + self.v.z;
@ -249,8 +249,8 @@ pub impl<T:Copy Num NumCast Trig Exp Extent Ord AngleConv> Quat<T>: Quaternion<T
}
#[inline(always)]
pure fn to_Mat4() -> Mat4<T> {
self.to_Mat3().to_Mat4()
pure fn to_mat4() -> Mat4<T> {
self.to_mat3().to_mat4()
}
}

View file

@ -84,11 +84,11 @@ fn test_Mat2() {
assert Mat2::from_value(6f).is_diagonal();
assert a.to_Mat3() == Mat3::new(1f, 3f, 0f,
assert a.to_mat3() == Mat3::new(1f, 3f, 0f,
2f, 4f, 0f,
0f, 0f, 1f);
assert a.to_Mat4() == Mat4::new(1f, 3f, 0f, 0f,
assert a.to_mat4() == Mat4::new(1f, 3f, 0f, 0f,
2f, 4f, 0f, 0f,
0f, 0f, 1f, 0f,
0f, 0f, 0f, 1f);
@ -200,7 +200,7 @@ fn test_Mat3() {
assert Mat3::from_value(6f).is_diagonal();
assert a.to_Mat4() == Mat4::new(1f, 4f, 7f, 0f,
assert a.to_mat4() == Mat4::new(1f, 4f, 7f, 0f,
2f, 5f, 8f, 0f,
3f, 6f, 9f, 0f,
0f, 0f, 0f, 1f);