bjz/cgmath-rs — pull request #37 by csherratt (2014-01-29 02:17:53+00:00)
Title: Add a translate constructor for Transform3D.

Summary:
- Implement ToMat4 for Transform3D and Quat
- Add a translate constructor for Transform3D

This does not enable anything the library does not already do. It just attempts to reduce the verboseness of doing it. #36 highlighted the Quat problem and I think it is harmless to offer this short cut.

Example of the verboseness (from ovr-rs)
Before:
```rust
let proj_left = Transform3D::new(1., Quat::zero(), Vec3::new(proj_off_center, 0., 0.)).get().to_mat4();
let proj_right = Transform3D::new(1., Quat::zero(), Vec3::new(-proj_off_center, 0., 0.)).get().to_mat4();
let proj_left = proj_left.mul_m(&proj_center);
let proj_right = proj_right.mul_m(&proj_center);

let view_left = Transform3D::new(1., Quat::zero(), Vec3::new(halfIPD, 0., 0.)).get().to_mat4();
let view_right = Transform3D::new(1., Quat::zero(), Vec3::new(-halfIPD, 0., 0.)).get().to_mat4();
let view_left = view_left.mul_m(view_center);
let view_right = view_right.mul_m(view_center);
```

After:
```rust
let proj_left = Transform3D::translate(proj_off_center, 0., 0.).to_mat4();
let proj_right = Transform3D::translate(-proj_off_center, 0., 0.).to_mat4();
let proj_left = proj_left.mul_m(&proj_center);
let proj_right = proj_right.mul_m(&proj_center);

let view_left = Transform3D::translate(halfIPD, 0., 0.).to_mat4();
let view_right = Transform3D::translate(-halfIPD, 0., 0.).to_mat4();
let view_left = view_left.mul_m(view_center);
let view_right = view_right.mul_m(view_center);
```