Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Added is_2d() and new_2d() methods to Matrix4D #134

Merged
merged 2 commits into from Mar 26, 2016
Merged
Changes from 1 commit
Commits
File filter...
Filter file types
Jump to…
Jump to file
Failed to load files.

Always

Just for now

Prev

tests for is_2d and new_2d

  • Loading branch information
peterjoel committed Mar 26, 2016
commit ca9eb2163f76bc5bf222f8d4bdd74fa4d26a38c5
@@ -27,6 +27,23 @@ pub fn test_ortho() {
assert!(result.approx_eq(&expected));
}

#[test]
pub fn test_is_2d() {
assert!(Matrix4::identity().is_2d());
assert!(Matrix4::create_rotation(0.0, 0.0, 1.0, 0.7854).is_2d());
assert!(!Matrix4::create_rotation(0.0, 1.0, 0.0, 0.7854).is_2d());
}

#[test]
pub fn test_new_2d() {
let m1 = Matrix4::new_2d(1.0, 2.0, 3.0, 4.0, 5.0, 6.0);
let m2 = Matrix4::new(1.0, 2.0, 0.0, 0.0,
3.0, 4.0, 0.0, 0.0,
0.0, 0.0, 1.0, 0.0,
5.0, 6.0, 0.0, 1.0);
assert_eq!(m1, m2);
}

#[test]
pub fn test_invert_simple() {
let m1 = Matrix4::identity();
ProTip! Use n and p to navigate between commits in a pull request.
You can’t perform that action at this time.