rmath3d_plain 1.2.0 → 1.2.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- checksums.yaml +4 -4
- data/ChangeLog +5 -0
- data/README.md +1 -1
- data/lib/rmath3d/rmath3d_plain.rb +64 -71
- metadata +3 -3
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 4bd79f02209d709b8cde29d2422b1b06e6060327
|
4
|
+
data.tar.gz: 6ad0f95013f28ab31c239d4b178fd112c649e759
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: f92594f33571d9de84b812d15c8801708ab5102b5d55eea71d1ad6425120f880eb08fb150f06d553c1d657506efc87fac5facf81c55db15f34ebc68e9f7f3762
|
7
|
+
data.tar.gz: 83ba8177dabbdd04f2e38949acd23b4ed20ae2d8e2bd3f7704a2f6c6137f283a5f5e3f51e0080c8ca3c0f41ef596cb8b2ad991cd873f798d3418fdd069dc8fa7
|
data/ChangeLog
CHANGED
@@ -1,3 +1,8 @@
|
|
1
|
+
2015-08-23 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
|
+
|
3
|
+
* rmath3d.c (def ==): Removed control path returning Qnil.
|
4
|
+
* rmath3d_plain.rb (def ==): Removed control path returning Qnil.
|
5
|
+
|
1
6
|
2015-05-02 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
7
|
|
3
8
|
* Ruby 1.9.3 and prior versions are no longer supported. Ref.: https://www.ruby-lang.org/en/news/2015/02/23/support-for-ruby-1-9-3-has-ended/
|
data/README.md
CHANGED
@@ -440,19 +440,18 @@ module RMath3D
|
|
440
440
|
# mtx1 == mtx2 : evaluates equality.
|
441
441
|
#
|
442
442
|
def ==( other )
|
443
|
-
if
|
444
|
-
|
445
|
-
|
446
|
-
|
447
|
-
|
448
|
-
|
449
|
-
for col in 0...2 do
|
450
|
-
if ( (getElement(row,col) - other.getElement(row,col)).abs > TOLERANCE )
|
451
|
-
return false
|
443
|
+
if other.class == RMtx2
|
444
|
+
for row in 0...2 do
|
445
|
+
for col in 0...2 do
|
446
|
+
if ( (getElement(row,col) - other.getElement(row,col)).abs > TOLERANCE )
|
447
|
+
return false
|
448
|
+
end
|
452
449
|
end
|
453
450
|
end
|
451
|
+
return true
|
452
|
+
else
|
453
|
+
return false
|
454
454
|
end
|
455
|
-
return true
|
456
455
|
end
|
457
456
|
|
458
457
|
#
|
@@ -1129,19 +1128,18 @@ module RMath3D
|
|
1129
1128
|
# mtx1 == mtx2 : evaluates equality.
|
1130
1129
|
#
|
1131
1130
|
def ==( other )
|
1132
|
-
if
|
1133
|
-
|
1134
|
-
|
1135
|
-
|
1136
|
-
|
1137
|
-
|
1138
|
-
for col in 0...3 do
|
1139
|
-
if ( (getElement(row,col) - other.getElement(row,col)).abs > TOLERANCE )
|
1140
|
-
return false
|
1131
|
+
if other.class == RMtx3
|
1132
|
+
for row in 0...3 do
|
1133
|
+
for col in 0...3 do
|
1134
|
+
if ( (getElement(row,col) - other.getElement(row,col)).abs > TOLERANCE )
|
1135
|
+
return false
|
1136
|
+
end
|
1141
1137
|
end
|
1142
1138
|
end
|
1139
|
+
return true
|
1140
|
+
else
|
1141
|
+
return false
|
1143
1142
|
end
|
1144
|
-
return true
|
1145
1143
|
end
|
1146
1144
|
|
1147
1145
|
#
|
@@ -2081,19 +2079,18 @@ module RMath3D
|
|
2081
2079
|
# mtx1 == mtx2 : evaluates equality.
|
2082
2080
|
#
|
2083
2081
|
def ==( other )
|
2084
|
-
if
|
2085
|
-
|
2086
|
-
|
2087
|
-
|
2088
|
-
|
2089
|
-
|
2090
|
-
for col in 0...4 do
|
2091
|
-
if ( (getElement(row,col) - other.getElement(row,col)).abs > TOLERANCE )
|
2092
|
-
return false
|
2082
|
+
if other.class == RMtx4
|
2083
|
+
for row in 0...4 do
|
2084
|
+
for col in 0...4 do
|
2085
|
+
if ( (getElement(row,col) - other.getElement(row,col)).abs > TOLERANCE )
|
2086
|
+
return false
|
2087
|
+
end
|
2093
2088
|
end
|
2094
2089
|
end
|
2090
|
+
return true
|
2091
|
+
else
|
2092
|
+
return false
|
2095
2093
|
end
|
2096
|
-
return true
|
2097
2094
|
end
|
2098
2095
|
|
2099
2096
|
#
|
@@ -2258,7 +2255,7 @@ module RMath3D
|
|
2258
2255
|
# Returns human-readable string.
|
2259
2256
|
#
|
2260
2257
|
def to_s
|
2261
|
-
return "( #{@e[0]}, #{@e[1]}, #{@e[2]}, #{@e[3]} )
|
2258
|
+
return "( #{@e[0]}, #{@e[1]}, #{@e[2]}, #{@e[3]} )"
|
2262
2259
|
end
|
2263
2260
|
|
2264
2261
|
#
|
@@ -2630,16 +2627,15 @@ module RMath3D
|
|
2630
2627
|
# quat1 == quat2 : evaluates equality.
|
2631
2628
|
#
|
2632
2629
|
def ==( other )
|
2633
|
-
if other.class
|
2634
|
-
|
2635
|
-
|
2636
|
-
|
2637
|
-
|
2638
|
-
|
2639
|
-
|
2640
|
-
|
2641
|
-
|
2642
|
-
return true
|
2630
|
+
if other.class == RQuat
|
2631
|
+
if (x-other.x).abs<=Float::EPSILON &&
|
2632
|
+
(y-other.y).abs<=Float::EPSILON &&
|
2633
|
+
(z-other.z).abs<=Float::EPSILON &&
|
2634
|
+
(w-other.w).abs<=Float::EPSILON
|
2635
|
+
return true
|
2636
|
+
else
|
2637
|
+
return false
|
2638
|
+
end
|
2643
2639
|
else
|
2644
2640
|
return false
|
2645
2641
|
end
|
@@ -2859,7 +2855,7 @@ module RMath3D
|
|
2859
2855
|
# Returns human-readable string.
|
2860
2856
|
#
|
2861
2857
|
def to_s
|
2862
|
-
return "( #{@e[0]}, #{@e[1]} )
|
2858
|
+
return "( #{@e[0]}, #{@e[1]} )"
|
2863
2859
|
end
|
2864
2860
|
|
2865
2861
|
#
|
@@ -3081,14 +3077,13 @@ module RMath3D
|
|
3081
3077
|
# vec1 == vec2 : evaluates equality.
|
3082
3078
|
#
|
3083
3079
|
def ==( other )
|
3084
|
-
if other.class
|
3085
|
-
|
3086
|
-
|
3087
|
-
|
3088
|
-
|
3089
|
-
|
3090
|
-
|
3091
|
-
return true
|
3080
|
+
if other.class == RVec2
|
3081
|
+
if (x-other.x).abs<=Float::EPSILON &&
|
3082
|
+
(y-other.y).abs<=Float::EPSILON
|
3083
|
+
return true
|
3084
|
+
else
|
3085
|
+
return false
|
3086
|
+
end
|
3092
3087
|
else
|
3093
3088
|
return false
|
3094
3089
|
end
|
@@ -3199,7 +3194,7 @@ module RMath3D
|
|
3199
3194
|
# Returns human-readable string.
|
3200
3195
|
#
|
3201
3196
|
def to_s
|
3202
|
-
return "( #{@e[0]}, #{@e[1]}, #{@e[2]} )
|
3197
|
+
return "( #{@e[0]}, #{@e[1]}, #{@e[2]} )"
|
3203
3198
|
end
|
3204
3199
|
|
3205
3200
|
#
|
@@ -3635,15 +3630,14 @@ module RMath3D
|
|
3635
3630
|
# vec1 == vec2 : evaluates equality.
|
3636
3631
|
#
|
3637
3632
|
def ==( other )
|
3638
|
-
if other.class
|
3639
|
-
|
3640
|
-
|
3641
|
-
|
3642
|
-
|
3643
|
-
|
3644
|
-
|
3645
|
-
|
3646
|
-
return true
|
3633
|
+
if other.class == RVec3
|
3634
|
+
if (x-other.x).abs<=Float::EPSILON &&
|
3635
|
+
(y-other.y).abs<=Float::EPSILON &&
|
3636
|
+
(z-other.z).abs<=Float::EPSILON
|
3637
|
+
return true
|
3638
|
+
else
|
3639
|
+
return false
|
3640
|
+
end
|
3647
3641
|
else
|
3648
3642
|
return false
|
3649
3643
|
end
|
@@ -3759,7 +3753,7 @@ module RMath3D
|
|
3759
3753
|
# Returns human-readable string.
|
3760
3754
|
#
|
3761
3755
|
def to_s
|
3762
|
-
return "( #{@e[0]}, #{@e[1]}, #{@e[2]}, #{@e[3]} )
|
3756
|
+
return "( #{@e[0]}, #{@e[1]}, #{@e[2]}, #{@e[3]} )"
|
3763
3757
|
end
|
3764
3758
|
|
3765
3759
|
#
|
@@ -4082,16 +4076,15 @@ module RMath3D
|
|
4082
4076
|
# vec1 == vec2 : evaluates equality.
|
4083
4077
|
#
|
4084
4078
|
def ==( other )
|
4085
|
-
if other.class
|
4086
|
-
|
4087
|
-
|
4088
|
-
|
4089
|
-
|
4090
|
-
|
4091
|
-
|
4092
|
-
|
4093
|
-
|
4094
|
-
return true
|
4079
|
+
if other.class == RVec4
|
4080
|
+
if (x-other.x).abs<=Float::EPSILON &&
|
4081
|
+
(y-other.y).abs<=Float::EPSILON &&
|
4082
|
+
(z-other.z).abs<=Float::EPSILON &&
|
4083
|
+
(w-other.w).abs<=Float::EPSILON
|
4084
|
+
return true
|
4085
|
+
else
|
4086
|
+
return false
|
4087
|
+
end
|
4095
4088
|
else
|
4096
4089
|
return false
|
4097
4090
|
end
|
metadata
CHANGED
@@ -1,14 +1,14 @@
|
|
1
1
|
--- !ruby/object:Gem::Specification
|
2
2
|
name: rmath3d_plain
|
3
3
|
version: !ruby/object:Gem::Version
|
4
|
-
version: 1.2.
|
4
|
+
version: 1.2.1
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaiorabbit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date: 2015-
|
11
|
+
date: 2015-08-23 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
Provides vector2/3/4, matrix2x2/3x3/4x4 and quaternion in plain Ruby form.
|
@@ -53,7 +53,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
|
|
53
53
|
version: '0'
|
54
54
|
requirements: []
|
55
55
|
rubyforge_project:
|
56
|
-
rubygems_version: 2.4.
|
56
|
+
rubygems_version: 2.4.5.1
|
57
57
|
signing_key:
|
58
58
|
specification_version: 4
|
59
59
|
summary: Ruby Math Module for 3D Applications
|