cyberarm_engine 0.3.0 → 0.4.0
Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA256:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: b8e3c0d7b4d22d0ed567dd1a1a710d5623e7d9f6e358a00d637f4965a37fbc68
|
4
|
+
data.tar.gz: db5e38d2bec4a4b6b8f1d5686b3bf5ab655bf07fb96939e04a833f42757404fd
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 4db0dfbe6039d8a96b92c8503e3bfa31138507769790071439f4400a08faf3edcdbdb8f99d4bbc30e8cf13235d0435ab86162a12115b02413b73b39e33a3a40a
|
7
|
+
data.tar.gz: 135412df0ee1186b953020a4e55c5ff8324250aaced8182283ed8799d28ba073da1119fc241694618a9bd23ab1125ae52ea88698d89ecca14b9d0cbe2619c557
|
@@ -48,6 +48,12 @@ module CyberarmEngine
|
|
48
48
|
end
|
49
49
|
end
|
50
50
|
|
51
|
+
def opacity(color, ratio = 1.0)
|
52
|
+
alpha = 255 * ratio
|
53
|
+
|
54
|
+
return Gosu::Color.rgba(color.red, color.green, color.blue, alpha)
|
55
|
+
end
|
56
|
+
|
51
57
|
def get_asset(path, hash, klass)
|
52
58
|
asset = nil
|
53
59
|
hash.detect do |_asset, instance|
|
@@ -2,9 +2,23 @@ module CyberarmEngine
|
|
2
2
|
class BoundingBox
|
3
3
|
attr_accessor :min, :max
|
4
4
|
|
5
|
-
def initialize(
|
6
|
-
|
7
|
-
|
5
|
+
def initialize(*args)
|
6
|
+
case args.size
|
7
|
+
when 0
|
8
|
+
@min = Vector.new(0, 0, 0)
|
9
|
+
@max = Vector.new(0, 0, 0)
|
10
|
+
when 2
|
11
|
+
@min = args.first.clone
|
12
|
+
@max = args.last.clone
|
13
|
+
when 4
|
14
|
+
@min = Vector.new(args[0], args[1], 0)
|
15
|
+
@max = Vector.new(args[2], args[3], 0)
|
16
|
+
when 6
|
17
|
+
@min = Vector.new(args[0], args[1], args[2])
|
18
|
+
@max = Vector.new(args[3], args[4], args[5])
|
19
|
+
else
|
20
|
+
raise "Invalid number of arguments! Got: #{args.size}, expected: 0, 2, 4, or 6."
|
21
|
+
end
|
8
22
|
end
|
9
23
|
|
10
24
|
def ==(other)
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: cyberarm_engine
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 0.
|
4
|
+
version: 0.4.0
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- Cyberarm
|
8
8
|
autorequire:
|
9
9
|
bindir: exe
|
10
10
|
cert_chain: []
|
11
|
-
date: 2019-
|
11
|
+
date: 2019-05-01 00:00:00.000000000 Z
|
12
12
|
dependencies:
|
13
13
|
- !ruby/object:Gem::Dependency
|
14
14
|
name: gosu
|