snow-math 0.0.2 → 1.0.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/snow-math.rb +1 -0
- data/lib/snow-math/array_cache.rb +26 -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: 06c2a2a9cd139c807ff150d18ca76fd89bee201c
|
4
|
+
data.tar.gz: 8c85e6d28b419162c6ded6d66bddd2ed7aae2af7
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 83c7950be8b9393e58e9ddb6549e1ab34ac30cc26abdd6e91651aa6753641522edc141159e5c658f3b4e4048d96ee97537b8d4f721449a698f96dc6721886ca8
|
7
|
+
data.tar.gz: 95666f511d19d35cadb78bec99051f536cb3a825c00fbbbc1437ca532a6b8fa749204173d1ccb31a1cf90db4c052a73d9e05d5b076f599f70155c5220ddbb3ac
|
data/lib/snow-math.rb
CHANGED
@@ -0,0 +1,26 @@
|
|
1
|
+
require 'snow-math/bindings'
|
2
|
+
|
3
|
+
module Snow
|
4
|
+
|
5
|
+
[:Vec3Array, :Vec4Array, :QuatArray, :Mat4Array].each {
|
6
|
+
|klass_sym|
|
7
|
+
if const_defined?(klass_sym)
|
8
|
+
const_get(klass_sym).class_exec {
|
9
|
+
alias_method :__fetch__, :fetch
|
10
|
+
alias_method :__array_cache_initialize__, :initialize
|
11
|
+
|
12
|
+
def initialize(*args)
|
13
|
+
@__cache__ = []
|
14
|
+
__array_cache_initialize__(*args)
|
15
|
+
end
|
16
|
+
|
17
|
+
def fetch(index)
|
18
|
+
@__cache__[index] || (@__cache__[index] = __fetch__(index))
|
19
|
+
end
|
20
|
+
|
21
|
+
alias_method :[], :fetch
|
22
|
+
}
|
23
|
+
end
|
24
|
+
}
|
25
|
+
|
26
|
+
end
|
metadata
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: snow-math
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.0
|
4
|
+
version: 1.0.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Noel Raymond Cower
|
@@ -17,6 +17,7 @@ extensions:
|
|
17
17
|
- ext/extconf.rb
|
18
18
|
extra_rdoc_files: []
|
19
19
|
files:
|
20
|
+
- lib/snow-math/array_cache.rb
|
20
21
|
- lib/snow-math/inspect.rb
|
21
22
|
- lib/snow-math/line.rb
|
22
23
|
- lib/snow-math/mat3.rb
|
@@ -55,7 +56,7 @@ required_ruby_version: !ruby/object:Gem::Requirement
|
|
55
56
|
requirements:
|
56
57
|
- - '>='
|
57
58
|
- !ruby/object:Gem::Version
|
58
|
-
version:
|
59
|
+
version: 2.0.0
|
59
60
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
60
61
|
requirements:
|
61
62
|
- - '>='
|