1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

remove # from gg and glm

This commit is contained in:
Alexander Medvednikov
2019-07-12 06:42:34 +02:00
parent e15c2da1f4
commit 5b3295db94
3 changed files with 35 additions and 36 deletions

View File

@@ -165,13 +165,13 @@ pub fn ortho(left, right, bottom, top f32) Mat4 {
//println('glm ortho($left, $right, $bottom, $top)')
// mat<4, 4, T, defaultp> Result(static_cast<T>(1));
n := 16
mut res := f32_calloc(n)
# res[0] = 2 / (right - left) ;
# res[5] = 2.0 / (top - bottom);
# res[10] = (1);
# res[12] = - (right + left) / (right - left);
# res[13] = - (top + bottom) / (top - bottom);
res[15] = 1
mut res := f32_calloc(n)
res[0] = 2.0 / f32(right - left)
res[5] = 2.0 / f32(top - bottom)
res[10] = 1.0
res[12] = - (right + left) / (right - left)
res[13] = - (top + bottom) / (top - bottom)
res[15] = 1.0
return mat4(res)
}
@@ -277,26 +277,26 @@ fn ortho_js(left, right, bottom, top f32) *f32 {
lr := 1.0 / (left - right)
bt := 1.0 / (bottom - top)
nf := 1.0 / 1.0// (mynear -myfar)
# f32* out = malloc (sizeof(f32) * 16);
# out[0] = -2 * lr;
# out[1] = 0;
# out[2] = 0;
# out[3] = 0;
# out[4] = 0;
# out[5] = -2 * bt;
# out[6] = 0;
# out[7] = 0;
# out[8] = 0;
# out[9] = 0;
# out[10] = 2 * nf;
# out[11] = 0;
# out[12] = (left + right) * lr;
# out[13] = (top + bottom) * bt;
# out[14] = 1 * nf;//(far + near) * nf;
# out[15] = 1;
# return out;
f := 0.0
return &f
mut out := (*f32)( malloc (sizeof(f32) * 16))
out[0] = -2.0 * lr
out[1] = 0
out[2] = 0
out[3] = 0
out[4] = 0
out[5] = -2.0 * bt
out[6] = 0
out[7] = 0
out[8] = 0
out[9] = 0
out[10] = 2.0 * nf
out[11] = 0
out[12] = (left + right) * lr
out[13] = (top + bottom) * bt
out[14] = 1.0 * nf//(far + near) * nf;
out[15] = 1
return out
//f := 0.0
//return &f
}
// fn ortho_old(a, b, c, d f32) *f32 {