OCD formatting

This commit is contained in:
Brendan Zabarauskas 2012-09-08 12:41:04 +10:00
parent 04bdd00576
commit 015f0d8eb1
2 changed files with 20 additions and 20 deletions

View file

@ -682,10 +682,10 @@ impl mat4: Matrix<float, vec4> {
impl mat4: Matrix4<float, vec4> { impl mat4: Matrix4<float, vec4> {
#[inline(always)] #[inline(always)]
pure fn scale(&&vec:vec3) -> mat4 { pure fn scale(&&vec:vec3) -> mat4 {
self.mul_m(mat4(vec.x(), 0f, 0f, 0f, self.mul_m(mat4(vec.x(), 0f, 0f, 0f,
0f, vec.y(), 0f, 0f, 0f, vec.y(), 0f, 0f,
0f, 0f, vec.z(), 0f, 0f, 0f, vec.z(), 0f,
0f, 0f, 0f, 1f)) 0f, 0f, 0f, 1f))
} }
#[inline(always)] #[inline(always)]

View file

@ -22,22 +22,22 @@ pure fn perspective(fovy:float, aspectRatio:float, near:float, far:float) -> mat
// TODO: double check algorithm // TODO: double check algorithm
// //
pure fn frustum(left:float, right:float, bottom:float, top:float, near:float, far:float) -> mat4 { pure fn frustum(left:float, right:float, bottom:float, top:float, near:float, far:float) -> mat4 {
let m00:float = (2f * near) / (right - left); let m00 = (2f * near) / (right - left);
let m01:float = 0f; let m01 = 0f;
let m02:float = 0f; let m02 = 0f;
let m03:float = 0f; let m03 = 0f;
let m10:float = 0f; let m10 = 0f;
let m11:float = (2f * near)/(top - bottom); let m11 = (2f * near)/(top - bottom);
let m12:float = 0f; let m12 = 0f;
let m13:float = 0f; let m13 = 0f;
let m20:float = (right + left) / (right - left); let m20 = (right + left) / (right - left);
let m21:float = (top + bottom) / (top - bottom); let m21 = (top + bottom) / (top - bottom);
let m22:float = -(far + near) / (far - near); let m22 = -(far + near) / (far - near);
let m23:float = -1f; let m23 = -1f;
let m30:float = 0f; let m30 = 0f;
let m31:float = 0f; let m31 = 0f;
let m32:float = -(2f * far * near) / (far - near); let m32 = -(2f * far * near) / (far - near);
let m33:float = 0f; let m33 = 0f;
return mat4(m00, m01, m02, m03, return mat4(m00, m01, m02, m03,
m10, m11, m12, m13, m10, m11, m12, m13,