rmath3d_plain 1.2.0 → 1.2.1

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
  SHA1:
3
- metadata.gz: 567a590ed8831150d12f0d35ca039929323e30fb
4
- data.tar.gz: 651e2d93e982e347292aada38d804238d41c4f15
3
+ metadata.gz: 4bd79f02209d709b8cde29d2422b1b06e6060327
4
+ data.tar.gz: 6ad0f95013f28ab31c239d4b178fd112c649e759
5
5
  SHA512:
6
- metadata.gz: 25403c0e9471559ad0cffb157c6c02843773722707143ae136d680e5bda58b07b1de6787eebd4fbdd84740bef8864db43f59091d0cc7a243488b3225ecb77160
7
- data.tar.gz: d151c7c04ef81bfd2767ffb69f7627c58ff2eb56611c7a0aa2990b2fc754ed316f80d55ae4b064a574db045626285f062ee1e3dbc221a26a1ac120aa592c4bd4
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
@@ -4,7 +4,7 @@
4
4
 
5
5
  rmath3d is a math module for 3D game programming and computer graphics.
6
6
 
7
- * Last Update: Mar 02, 2015
7
+ * Last Update: Aug 23, 2015
8
8
  * Since: Jul 20, 2008
9
9
 
10
10
  ## Features ##
@@ -440,19 +440,18 @@ module RMath3D
440
440
  # mtx1 == mtx2 : evaluates equality.
441
441
  #
442
442
  def ==( other )
443
- if ( other.class != RMtx2 )
444
- raise TypeError, "RMtx2#==(other) : Unknown type #{other.class} given as RMtx2."
445
- return nil
446
- end
447
-
448
- for row in 0...2 do
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 ( other.class != RMtx3 )
1133
- raise TypeError, "RMtx3#==(other) : Unknown type #{other.class} given as RMtx3."
1134
- return nil
1135
- end
1136
-
1137
- for row in 0...3 do
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 ( other.class != RMtx4 )
2085
- raise TypeError, "RMtx4#==(other) : Unknown type #{other.class} given as RMtx4."
2086
- return nil
2087
- end
2088
-
2089
- for row in 0...4 do
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]} )\n"
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 != RQuat
2634
- raise TypeError, "RQuat#== : Unknown type #{other.class}."
2635
- return nil
2636
- end
2637
-
2638
- if (x-other.x).abs<=Float::EPSILON &&
2639
- (y-other.y).abs<=Float::EPSILON &&
2640
- (z-other.z).abs<=Float::EPSILON &&
2641
- (w-other.w).abs<=Float::EPSILON
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]} )\n"
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 != RVec2
3085
- raise TypeError, "RVec2#== : Unknown type #{other.class}."
3086
- return nil
3087
- end
3088
-
3089
- if (x-other.x).abs<=Float::EPSILON &&
3090
- (y-other.y).abs<=Float::EPSILON
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]} )\n"
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 != RVec3
3639
- raise TypeError, "RVec3#== : Unknown type #{other.class}."
3640
- return nil
3641
- end
3642
-
3643
- if (x-other.x).abs<=Float::EPSILON &&
3644
- (y-other.y).abs<=Float::EPSILON &&
3645
- (z-other.z).abs<=Float::EPSILON
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]} )\n"
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 != RVec4
4086
- raise TypeError, "RVec4#== : Unknown type #{other.class}."
4087
- return nil
4088
- end
4089
-
4090
- if (x-other.x).abs<=Float::EPSILON &&
4091
- (y-other.y).abs<=Float::EPSILON &&
4092
- (z-other.z).abs<=Float::EPSILON &&
4093
- (w-other.w).abs<=Float::EPSILON
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.0
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-05-02 00:00:00.000000000 Z
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.6
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