snow-math 1.5.1 → 1.5.3
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/README.md +1 -1
- data/ext/snow-math/mat4.c +7 -11
- data/lib/snow-math.rb +1 -12
- data/lib/snow-math/version.rb +12 -0
- metadata +3 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 3a51bb323669b2f4f06bba42373bee886ff6fe5b
|
4
|
+
data.tar.gz: 89770e67ef087bd254efd4138ffa60acf345baac
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: c88c4b0e95a1791b79ce954cd5411e17468a37fa603c00066fdd80133ee4b5275299afed4f0705962bc211d2d2f0c4c2ac6ee550be226a15df313af36386853a
|
7
|
+
data.tar.gz: 39428e2b13941b242a1b642c901751bf857ca08740b57e602c5f8b42653490543a7834e3c9ebf756a48f107bb363589c2cc1e9e43e9696a1748ec3418b42e82a
|
data/README.md
CHANGED
data/ext/snow-math/mat4.c
CHANGED
@@ -235,15 +235,15 @@ void mat4_frustum(s_float_t left, s_float_t right, s_float_t bottom, s_float_t t
|
|
235
235
|
const s_float_t xdelta = right - left;
|
236
236
|
const s_float_t ydelta = top - bottom;
|
237
237
|
const s_float_t zdelta = far - near;
|
238
|
-
const s_float_t
|
238
|
+
const s_float_t two_near = s_float_lit(2.0) * near;
|
239
239
|
|
240
|
-
out[0] =
|
240
|
+
out[0] = two_near / xdelta;
|
241
241
|
out[2] = (right + left) / xdelta;
|
242
|
-
out[5] =
|
242
|
+
out[5] = two_near / ydelta;
|
243
243
|
out[6] = (top + bottom) / ydelta;
|
244
244
|
out[10] = -((far + near) / zdelta);
|
245
245
|
out[11] = s_float_lit(-1.0);
|
246
|
-
out[14] = -((
|
246
|
+
out[14] = -((two_near * far) / zdelta);
|
247
247
|
out[1] = out[3] = out[4] =
|
248
248
|
out[7] = out[8] = out[9] =
|
249
249
|
out[12] = out[13] = out[15] = s_float_lit(0.0);
|
@@ -269,16 +269,12 @@ void mat4_orthographic(s_float_t left, s_float_t right, s_float_t bottom, s_floa
|
|
269
269
|
|
270
270
|
void mat4_perspective(s_float_t fov_y, s_float_t aspect, s_float_t near, s_float_t far, mat4_t out)
|
271
271
|
{
|
272
|
-
const s_float_t
|
273
|
-
const s_float_t left = -r * aspect;
|
274
|
-
const s_float_t right = r * aspect;
|
275
|
-
const s_float_t bottom = -r;
|
276
|
-
const s_float_t top = r;
|
272
|
+
const s_float_t cotan = s_float_lit(1.0) / s_tan(fov_y * s_float_lit(0.5) * S_DEG2RAD);
|
277
273
|
const s_float_t two_near = s_float_lit(2.0) * near;
|
278
274
|
const s_float_t zdelta = s_float_lit(1.0) / (near - far);
|
279
275
|
|
280
|
-
out[0] =
|
281
|
-
out[5] =
|
276
|
+
out[0] = cotan / aspect;
|
277
|
+
out[5] = cotan;
|
282
278
|
out[10] = (far + near) * zdelta;
|
283
279
|
out[11] = s_float_lit(-1.0);
|
284
280
|
out[14] = (two_near * far) * zdelta;
|
data/lib/snow-math.rb
CHANGED
@@ -2,6 +2,7 @@
|
|
2
2
|
# Copyright (c) 2013 Noel Raymond Cower. All rights reserved.
|
3
3
|
# See COPYING for license details.
|
4
4
|
|
5
|
+
require 'snow-math/version'
|
5
6
|
require 'snow-math/bindings'
|
6
7
|
require 'snow-math/vec2'
|
7
8
|
require 'snow-math/vec3'
|
@@ -13,15 +14,3 @@ require 'snow-math/swizzle'
|
|
13
14
|
require 'snow-math/inspect'
|
14
15
|
require 'snow-math/to_a'
|
15
16
|
require 'snow-math/marshal'
|
16
|
-
|
17
|
-
#
|
18
|
-
# Snow module -- covers Snow-related classes and methods.
|
19
|
-
#
|
20
|
-
module Snow
|
21
|
-
|
22
|
-
#
|
23
|
-
# snow-math bindings version string.
|
24
|
-
#
|
25
|
-
SNOW_MATH_VERSION = '1.5.1'
|
26
|
-
|
27
|
-
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snow-math
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.5.
|
4
|
+
version: 1.5.3
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noel Raymond Cower
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2013-07-
|
11
|
+
date: 2013-07-24 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: Math types built on the SnowPalm math code
|
14
14
|
email: ncower@gmail.com
|
@@ -31,6 +31,7 @@ files:
|
|
31
31
|
- lib/snow-math/vec2.rb
|
32
32
|
- lib/snow-math/vec3.rb
|
33
33
|
- lib/snow-math/vec4.rb
|
34
|
+
- lib/snow-math/version.rb
|
34
35
|
- lib/snow-math.rb
|
35
36
|
- ext/snow-math/mat3.c
|
36
37
|
- ext/snow-math/mat4.c
|