Clean up formatting
This commit is contained in:
parent
b8996e124d
commit
f7364ce42a
1 changed files with 26 additions and 31 deletions
|
@ -15,15 +15,12 @@
|
||||||
|
|
||||||
use std::{fmt, num};
|
use std::{fmt, num};
|
||||||
|
|
||||||
use std::num::one;
|
|
||||||
|
|
||||||
use approx::ApproxEq;
|
use approx::ApproxEq;
|
||||||
use matrix::{Matrix, Matrix4, ToMatrix4};
|
use matrix::{Matrix, Matrix4, ToMatrix4};
|
||||||
use num::{BaseNum, BaseFloat};
|
use num::{BaseNum, BaseFloat};
|
||||||
use point::{Point, Point3};
|
use point::{Point, Point3};
|
||||||
use ray::Ray;
|
use ray::Ray;
|
||||||
use rotation::{Rotation, Rotation3};
|
use rotation::{Rotation, Rotation3};
|
||||||
use quaternion::Quaternion;
|
|
||||||
use vector::{Vector, Vector3};
|
use vector::{Vector, Vector3};
|
||||||
|
|
||||||
/// A trait representing an [affine
|
/// A trait representing an [affine
|
||||||
|
@ -129,8 +126,7 @@ impl<S: BaseFloat, V: Vector<S>, P: Point<S, V>, R: Rotation<S, V, P>> Transform
|
||||||
if self.scale.approx_eq(&num::zero()) {
|
if self.scale.approx_eq(&num::zero()) {
|
||||||
None
|
None
|
||||||
} else {
|
} else {
|
||||||
let _1 : S = num::one();
|
let s = num::one::<S>() / self.scale;
|
||||||
let s = _1 / self.scale;
|
|
||||||
let r = self.rot.invert();
|
let r = self.rot.invert();
|
||||||
let d = r.rotate_vector(&self.disp).mul_s(-s);
|
let d = r.rotate_vector(&self.disp).mul_s(-s);
|
||||||
Some(Decomposed {
|
Some(Decomposed {
|
||||||
|
@ -161,7 +157,6 @@ impl<S: BaseFloat, R: fmt::Show + Rotation3<S>> fmt::Show for Decomposed<S,Vecto
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
/// A homogeneous transformation matrix.
|
/// A homogeneous transformation matrix.
|
||||||
pub struct AffineMatrix3<S> {
|
pub struct AffineMatrix3<S> {
|
||||||
pub mat: Matrix4<S>,
|
pub mat: Matrix4<S>,
|
||||||
|
|
Loading…
Reference in a new issue