OCD formatting
This commit is contained in:
parent
04bdd00576
commit
015f0d8eb1
2 changed files with 20 additions and 20 deletions
|
@ -682,10 +682,10 @@ impl mat4: Matrix<float, vec4> {
|
|||
impl mat4: Matrix4<float, vec4> {
|
||||
#[inline(always)]
|
||||
pure fn scale(&&vec:vec3) -> mat4 {
|
||||
self.mul_m(mat4(vec.x(), 0f, 0f, 0f,
|
||||
0f, vec.y(), 0f, 0f,
|
||||
0f, 0f, vec.z(), 0f,
|
||||
0f, 0f, 0f, 1f))
|
||||
self.mul_m(mat4(vec.x(), 0f, 0f, 0f,
|
||||
0f, vec.y(), 0f, 0f,
|
||||
0f, 0f, vec.z(), 0f,
|
||||
0f, 0f, 0f, 1f))
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
|
|
|
@ -22,22 +22,22 @@ pure fn perspective(fovy:float, aspectRatio:float, near:float, far:float) -> mat
|
|||
// TODO: double check algorithm
|
||||
//
|
||||
pure fn frustum(left:float, right:float, bottom:float, top:float, near:float, far:float) -> mat4 {
|
||||
let m00:float = (2f * near) / (right - left);
|
||||
let m01:float = 0f;
|
||||
let m02:float = 0f;
|
||||
let m03:float = 0f;
|
||||
let m10:float = 0f;
|
||||
let m11:float = (2f * near)/(top - bottom);
|
||||
let m12:float = 0f;
|
||||
let m13:float = 0f;
|
||||
let m20:float = (right + left) / (right - left);
|
||||
let m21:float = (top + bottom) / (top - bottom);
|
||||
let m22:float = -(far + near) / (far - near);
|
||||
let m23:float = -1f;
|
||||
let m30:float = 0f;
|
||||
let m31:float = 0f;
|
||||
let m32:float = -(2f * far * near) / (far - near);
|
||||
let m33:float = 0f;
|
||||
let m00 = (2f * near) / (right - left);
|
||||
let m01 = 0f;
|
||||
let m02 = 0f;
|
||||
let m03 = 0f;
|
||||
let m10 = 0f;
|
||||
let m11 = (2f * near)/(top - bottom);
|
||||
let m12 = 0f;
|
||||
let m13 = 0f;
|
||||
let m20 = (right + left) / (right - left);
|
||||
let m21 = (top + bottom) / (top - bottom);
|
||||
let m22 = -(far + near) / (far - near);
|
||||
let m23 = -1f;
|
||||
let m30 = 0f;
|
||||
let m31 = 0f;
|
||||
let m32 = -(2f * far * near) / (far - near);
|
||||
let m33 = 0f;
|
||||
|
||||
return mat4(m00, m01, m02, m03,
|
||||
m10, m11, m12, m13,
|
||||
|
|
Loading…
Reference in a new issue