rmath3d 1.2.1 → 1.2.2

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.
@@ -29,7 +29,7 @@ module RMath3D
29
29
  0.0, 0.0 ]
30
30
  when 1
31
31
  case a[0]
32
- when Fixnum, Float
32
+ when Float, Integer, Fixnum, Bignum
33
33
  @e = [ a[0], a[0],
34
34
  a[0], a[0] ]
35
35
  when RMtx2
@@ -46,7 +46,7 @@ module RMath3D
46
46
  for col in 0...2 do
47
47
  index = 2*row + col
48
48
  case a[index]
49
- when Fixnum, Float
49
+ when Float, Integer, Fixnum, Bignum
50
50
  setElement( row, col, a[index] )
51
51
  else
52
52
  raise TypeError, "RMtx2#initialize : Unknown type #{a[0].class}."
@@ -88,7 +88,7 @@ module RMath3D
88
88
  #
89
89
  def coerce
90
90
  case arg
91
- when Fixnum, Float, Bignum
91
+ when Float, Integer, Fixnum, Bignum
92
92
  return [ self, arg ]
93
93
  else
94
94
  raise TypeError, "RMtx2#coerce : #{arg.self} can't be coerced into #{self.class}."
@@ -411,7 +411,7 @@ module RMath3D
411
411
  #
412
412
  def *( arg )
413
413
  case arg
414
- when Fixnum, Float, Bignum
414
+ when Float, Integer, Fixnum, Bignum
415
415
  return RMtx2.new( arg*self.e00, arg*self.e01,
416
416
  arg*self.e10, arg*self.e11 )
417
417
 
@@ -503,7 +503,7 @@ module RMath3D
503
503
  #
504
504
  def mul!( other )
505
505
  case other
506
- when Fixnum, Float, Bignum
506
+ when Float, Integer, Fixnum, Bignum
507
507
  self.e00 = other*self.e00
508
508
  self.e01 = other*self.e01
509
509
  self.e10 = other*self.e10
@@ -560,7 +560,7 @@ module RMath3D
560
560
  0.0, 0.0, 0.0 ]
561
561
  when 1
562
562
  case a[0]
563
- when Fixnum, Float
563
+ when Float, Integer, Fixnum, Bignum
564
564
  @e = [ a[0], a[0], a[0],
565
565
  a[0], a[0], a[0],
566
566
  a[0], a[0], a[0] ]
@@ -579,7 +579,7 @@ module RMath3D
579
579
  for col in 0...3 do
580
580
  index = 3*row + col
581
581
  case a[index]
582
- when Fixnum, Float
582
+ when Float, Integer, Fixnum, Bignum
583
583
  setElement( row, col, a[index] )
584
584
  else
585
585
  raise TypeError, "RMtx3#initialize : Unknown type #{a[0].class}."
@@ -622,7 +622,7 @@ module RMath3D
622
622
  #
623
623
  def coerce
624
624
  case arg
625
- when Fixnum, Float, Bignum
625
+ when Float, Integer, Fixnum, Bignum
626
626
  return [ self, arg ]
627
627
  else
628
628
  raise TypeError, "RMtx3#coerce : #{arg.self} can't be coerced into #{self.class}."
@@ -1098,7 +1098,7 @@ module RMath3D
1098
1098
  #
1099
1099
  def *( arg )
1100
1100
  case arg
1101
- when Fixnum, Float, Bignum
1101
+ when Float, Integer, Fixnum, Bignum
1102
1102
  return RMtx3.new( arg*self.e00, arg*self.e01, arg*self.e02,
1103
1103
  arg*self.e10, arg*self.e11, arg*self.e12,
1104
1104
  arg*self.e20, arg*self.e21, arg*self.e22 )
@@ -1191,7 +1191,7 @@ module RMath3D
1191
1191
  #
1192
1192
  def mul!( other )
1193
1193
  case other
1194
- when Fixnum, Float, Bignum
1194
+ when Float, Integer, Fixnum, Bignum
1195
1195
  self.e00 = other*self.e00
1196
1196
  self.e01 = other*self.e01
1197
1197
  self.e02 = other*self.e02
@@ -1259,7 +1259,7 @@ module RMath3D
1259
1259
  0.0, 0.0, 0.0, 0.0 ]
1260
1260
  when 1
1261
1261
  case a[0]
1262
- when Fixnum, Float
1262
+ when Float, Integer, Fixnum, Bignum
1263
1263
  @e = [ a[0], a[0], a[0], a[0],
1264
1264
  a[0], a[0], a[0], a[0],
1265
1265
  a[0], a[0], a[0], a[0],
@@ -1280,7 +1280,7 @@ module RMath3D
1280
1280
  for col in 0...4 do
1281
1281
  index = 4*row + col
1282
1282
  case a[index]
1283
- when Fixnum, Float
1283
+ when Float, Integer, Fixnum, Bignum
1284
1284
  setElement( row, col, a[index] )
1285
1285
  else
1286
1286
  raise TypeError, "RMtx4#initialize : Unknown type #{a[0].class}."
@@ -1324,7 +1324,7 @@ module RMath3D
1324
1324
  #
1325
1325
  def coerce
1326
1326
  case arg
1327
- when Fixnum, Float, Bignum
1327
+ when Float, Integer, Fixnum, Bignum
1328
1328
  return [ self, arg ]
1329
1329
  else
1330
1330
  raise TypeError, "RMtx4#coerce : #{arg.self} can't be coerced into #{self.class}."
@@ -2048,7 +2048,7 @@ module RMath3D
2048
2048
  #
2049
2049
  def *( arg )
2050
2050
  case arg
2051
- when Fixnum, Float, Bignum
2051
+ when Float, Integer, Fixnum, Bignum
2052
2052
  return RMtx4.new( arg*self.e00, arg*self.e01, arg*self.e02, arg*self.e03,
2053
2053
  arg*self.e10, arg*self.e11, arg*self.e12, arg*self.e13,
2054
2054
  arg*self.e20, arg*self.e21, arg*self.e22, arg*self.e23,
@@ -2142,7 +2142,7 @@ module RMath3D
2142
2142
  #
2143
2143
  def mul!( other )
2144
2144
  case other
2145
- when Fixnum, Float, Bignum
2145
+ when Float, Integer, Fixnum, Bignum
2146
2146
  self.e00 = other*self.e00
2147
2147
  self.e01 = other*self.e01
2148
2148
  self.e02 = other*self.e02
@@ -2224,7 +2224,7 @@ module RMath3D
2224
2224
  @e = [0.0, 0.0, 0.0, 0.0]
2225
2225
  when 1
2226
2226
  case a[0]
2227
- when Fixnum, Float
2227
+ when Float, Integer, Fixnum, Bignum
2228
2228
  @e = [ a[0], a[0], a[0], a[0] ]
2229
2229
  when RQuat
2230
2230
  @e = [ a[0].x, a[0].y, a[0].z, a[0].w ]
@@ -2235,7 +2235,7 @@ module RMath3D
2235
2235
  when 4
2236
2236
  a.each_with_index do |elem, index|
2237
2237
  case elem
2238
- when Fixnum, Float
2238
+ when Float, Integer, Fixnum, Bignum
2239
2239
  @e[index] = elem
2240
2240
  else
2241
2241
  raise TypeError, "RQuat#initialize : Unknown type #{elem.class}."
@@ -2274,7 +2274,7 @@ module RMath3D
2274
2274
  #
2275
2275
  def coerce( arg )
2276
2276
  case arg
2277
- when Fixnum, Float, Bignum
2277
+ when Float, Integer, Fixnum, Bignum
2278
2278
  return [ self, arg ]
2279
2279
  else
2280
2280
  raise TypeError, "RQuat#coerce : #{arg.self} can't be coerced into #{self.class}."
@@ -2613,7 +2613,7 @@ module RMath3D
2613
2613
  z = q1w*q2z + q1x*q2y - q1y*q2x + q1z*q2w
2614
2614
  w = q1w*q2w - q1x*q2x - q1y*q2y - q1z*q2z
2615
2615
  return RQuat.new( x, y, z, w )
2616
- when Fixnum, Float
2616
+ when Float, Integer, Fixnum, Bignum
2617
2617
  return RQuat.new( @e[0]*arg, @e[1]*arg, @e[2]*arg, @e[3]*arg )
2618
2618
  else
2619
2619
  raise TypeError, "RQuat#* : Unknown type #{arg}."
@@ -2708,7 +2708,7 @@ module RMath3D
2708
2708
 
2709
2709
  return self
2710
2710
 
2711
- when Fixnum, Float
2711
+ when Float, Integer, Fixnum, Bignum
2712
2712
  self.x *= other
2713
2713
  self.y *= other
2714
2714
  self.z *= other
@@ -2824,7 +2824,7 @@ module RMath3D
2824
2824
  @e = [0.0, 0.0]
2825
2825
  when 1
2826
2826
  case a[0]
2827
- when Fixnum, Float
2827
+ when Float, Integer, Fixnum, Bignum
2828
2828
  @e = [ a[0], a[0] ]
2829
2829
  when RVec2
2830
2830
  @e = [ a[0].x, a[0].y ]
@@ -2835,7 +2835,7 @@ module RMath3D
2835
2835
  when 2
2836
2836
  a.each_with_index do |elem, index|
2837
2837
  case elem
2838
- when Fixnum, Float
2838
+ when Float, Integer, Fixnum, Bignum
2839
2839
  @e[index] = elem
2840
2840
  else
2841
2841
  raise TypeError, "RVec2#initialize : Unknown type #{elem.class}."
@@ -2874,7 +2874,7 @@ module RMath3D
2874
2874
  #
2875
2875
  def coerce( arg )
2876
2876
  case arg
2877
- when Fixnum, Float, Bignum
2877
+ when Float, Integer, Fixnum, Bignum
2878
2878
  return [ self, arg ]
2879
2879
  else
2880
2880
  raise TypeError, "RVec2#coerce : #{arg.self} can't be coerced into #{self.class}."
@@ -3063,7 +3063,7 @@ module RMath3D
3063
3063
  #
3064
3064
  def *( arg )
3065
3065
  case arg
3066
- when Fixnum, Float
3066
+ when Float, Integer, Fixnum, Bignum
3067
3067
  return RVec2.new( @e[0]*arg, @e[1]*arg )
3068
3068
  else
3069
3069
  raise TypeError, "RVec2#* : Unknown type #{arg}."
@@ -3129,7 +3129,7 @@ module RMath3D
3129
3129
  # vec1 *= vec2
3130
3130
  #
3131
3131
  def mul!( arg )
3132
- if arg.class != Fixnum && arg.class != Float
3132
+ if !(arg.class == Float || arg.class == Integer || arg.class == Fixnum || arg.class == Bignum)
3133
3133
  raise TypeError, "RVec2#mul! : Unknown type #{arg.class}."
3134
3134
  return nil
3135
3135
  end
@@ -3163,7 +3163,7 @@ module RMath3D
3163
3163
  @e = [0.0, 0.0, 0.0]
3164
3164
  when 1
3165
3165
  case a[0]
3166
- when Fixnum, Float
3166
+ when Float, Integer, Fixnum, Bignum
3167
3167
  @e = [ a[0], a[0], a[0] ]
3168
3168
  when RVec3
3169
3169
  @e = [ a[0].x, a[0].y, a[0].z ]
@@ -3174,7 +3174,7 @@ module RMath3D
3174
3174
  when 3
3175
3175
  a.each_with_index do |elem, index|
3176
3176
  case elem
3177
- when Fixnum, Float
3177
+ when Float, Integer, Fixnum, Bignum
3178
3178
  @e[index] = elem
3179
3179
  else
3180
3180
  raise TypeError, "RVec3#initialize : Unknown type #{elem.class}."
@@ -3213,7 +3213,7 @@ module RMath3D
3213
3213
  #
3214
3214
  def coerce( arg )
3215
3215
  case arg
3216
- when Fixnum, Float, Bignum
3216
+ when Float, Integer, Fixnum, Bignum
3217
3217
  return [ self, arg ]
3218
3218
  else
3219
3219
  raise TypeError, "RVec3#coerce : #{arg.self} can't be coerced into #{self.class}."
@@ -3616,7 +3616,7 @@ module RMath3D
3616
3616
  #
3617
3617
  def *( arg )
3618
3618
  case arg
3619
- when Fixnum, Float
3619
+ when Float, Integer, Fixnum, Bignum
3620
3620
  return RVec3.new( @e[0]*arg, @e[1]*arg, @e[2]*arg )
3621
3621
  else
3622
3622
  raise TypeError, "RVec3#* : Unknown type #{arg}."
@@ -3685,7 +3685,7 @@ module RMath3D
3685
3685
  # vec1 *= vec2
3686
3686
  #
3687
3687
  def mul!( arg )
3688
- if arg.class != Fixnum && arg.class != Float
3688
+ if !(arg.class == Float || arg.class == Integer || arg.class == Fixnum || arg.class == Bignum)
3689
3689
  raise TypeError, "RVec3#mul! : Unknown type #{arg.class}."
3690
3690
  return nil
3691
3691
  end
@@ -3720,7 +3720,7 @@ module RMath3D
3720
3720
  @e = [0.0, 0.0, 0.0, 0.0]
3721
3721
  when 1
3722
3722
  case a[0]
3723
- when Fixnum, Float
3723
+ when Float, Integer, Fixnum, Bignum
3724
3724
  @e = [ a[0], a[0], a[0], a[0] ]
3725
3725
  when RVec3
3726
3726
  @e = [ a[0].x, a[0].y, a[0].z, 0.0 ]
@@ -3733,7 +3733,7 @@ module RMath3D
3733
3733
  when 4
3734
3734
  a.each_with_index do |elem, index|
3735
3735
  case elem
3736
- when Fixnum, Float
3736
+ when Float, Integer, Fixnum, Bignum
3737
3737
  @e[index] = elem
3738
3738
  else
3739
3739
  raise TypeError, "RVec4#initialize : Unknown type #{elem.class}."
@@ -3772,7 +3772,7 @@ module RMath3D
3772
3772
  #
3773
3773
  def coerce( arg )
3774
3774
  case arg
3775
- when Fixnum, Float, Bignum
3775
+ when Float, Integer, Fixnum, Bignum
3776
3776
  return [ self, arg ]
3777
3777
  else
3778
3778
  raise TypeError, "RVec4#coerce : #{arg.self} can't be coerced into #{self.class}."
@@ -4062,7 +4062,7 @@ module RMath3D
4062
4062
  #
4063
4063
  def *( arg )
4064
4064
  case arg
4065
- when Fixnum, Float
4065
+ when Float, Integer, Fixnum, Bignum
4066
4066
  return RVec4.new( @e[0]*arg, @e[1]*arg, @e[2]*arg, @e[3]*arg )
4067
4067
  else
4068
4068
  raise TypeError, "RVec4#* : Unknown type #{arg}."
@@ -4134,7 +4134,7 @@ module RMath3D
4134
4134
  # vec1 *= vec2
4135
4135
  #
4136
4136
  def mul!( other )
4137
- if other.class != Fixnum && other.class != Float
4137
+ if !(other.class == Float || other.class == Integer || other.class == Fixnum || other.class == Bignum)
4138
4138
  raise TypeError, "RVec4#mul! : Unknown type #{other.class}."
4139
4139
  return nil
4140
4140
  end
@@ -4152,7 +4152,7 @@ end
4152
4152
 
4153
4153
  =begin
4154
4154
  RMath : Ruby math module for 3D Applications
4155
- Copyright (c) 2008- vaiorabbit <http://twitter.com/vaiorabbit>
4155
+ Copyright (c) 2008-2017 vaiorabbit <http://twitter.com/vaiorabbit>
4156
4156
 
4157
4157
  This software is provided 'as-is', without any express or implied
4158
4158
  warranty. In no event will the authors be held liable for any damages
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: rmath3d
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.2.1
4
+ version: 1.2.2
5
5
  platform: ruby
6
6
  authors:
7
7
  - vaiorabbit
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2015-08-23 00:00:00.000000000 Z
11
+ date: 2017-07-22 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: |
14
14
  Provides vector2/3/4, matrix2x2/3x3/4x4 and quaternion in C extension library form (and plain Ruby form with the same interface for debugging use).
@@ -56,7 +56,7 @@ files:
56
56
  - test/test_RVec4.rb
57
57
  homepage: https://github.com/vaiorabbit/rmath3d
58
58
  licenses:
59
- - zlib/libpng
59
+ - Zlib
60
60
  metadata: {}
61
61
  post_install_message:
62
62
  rdoc_options: []
@@ -74,7 +74,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
74
74
  version: '0'
75
75
  requirements: []
76
76
  rubyforge_project:
77
- rubygems_version: 2.4.5.1
77
+ rubygems_version: 2.6.12
78
78
  signing_key:
79
79
  specification_version: 4
80
80
  summary: Ruby Math Module for 3D Applications