snow-math 1.4.2 → 1.5.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: 9a85f485d607f507213ddfc79b09c0f7429364bb
4
- data.tar.gz: 3e517d63c5721f56bd5455de3ed62c0d6854581b
3
+ metadata.gz: 5f5696ed257e851e8ed109d5fbf527841504d090
4
+ data.tar.gz: dc7f9f39fae35757d29bda44a1d1c3c27c5e619f
5
5
  SHA512:
6
- metadata.gz: 3f9ec0589e102f5c9dac662f77fc09cb00fa7878d4a4b9081363db47ab23748c2bef7ee64fab4b3b0425112bb3c8dcb0948ba4d6804c2f88b0cea63de545e699
7
- data.tar.gz: 3f72346489f5b5ff2314fcf0c561a27279e57d881db65ee69f4ee8ab9cab74e9e1800c59dc4a1cd527b3e5c59108fcc81d6792665a23d24ec8d5d69cf42c6ad4
6
+ metadata.gz: d14a2833f14fa0be4ce7e6c3a3a5de78d070d5018b8f5908c2be9eb9ad352e5fc4faaf946ea8b6a57602d8ca5bf5faa6dda12356d622139939d351a3abd9ead8
7
+ data.tar.gz: a2269af59520da80c1a950d39d46e1264f13f29bd08a720e773a0a71d8cda5d7039156c31db3c593ce9a211155a55bf453762e4136d9b3c4a8ea41faaf2ea7d5
@@ -6522,7 +6522,8 @@ static VALUE sm_get_address(VALUE sm_self)
6522
6522
 
6523
6523
  void Init_bindings()
6524
6524
  {
6525
- ID kRB_CONST_SIZE, kRB_CONST_LENGTH, kRB_CONST_FLOAT_SIZE, kRB_CONST_TYPE;
6525
+ ID kRB_CONST_SIZE, kRB_CONST_LENGTH, kRB_CONST_FLOAT_SIZE, kRB_CONST_TYPE,
6526
+ kRB_SIZE_METHOD, kRB_BYTESIZE_METHOD;
6526
6527
 
6527
6528
  kRB_IVAR_MATHARRAY_LENGTH = rb_intern("__length");
6528
6529
  kRB_IVAR_MATHARRAY_CACHE = rb_intern("__cache");
@@ -6531,6 +6532,8 @@ void Init_bindings()
6531
6532
  kRB_CONST_LENGTH = rb_intern("LENGTH");
6532
6533
  kRB_CONST_FLOAT_SIZE = rb_intern("SNOW_MATH_FLOAT_SIZE");
6533
6534
  kRB_CONST_TYPE = rb_intern("TYPE");
6535
+ kRB_SIZE_METHOD = rb_intern("size");
6536
+ kRB_BYTESIZE_METHOD = rb_intern("bytesize");
6534
6537
 
6535
6538
  /*
6536
6539
  * The size in bytes of the base snow-math floating point type. Set to 4 when
@@ -6538,12 +6541,12 @@ void Init_bindings()
6538
6541
  */
6539
6542
 
6540
6543
  s_sm_snowmath_mod = rb_define_module("Snow");
6541
- s_sm_vec2_klass = rb_define_class_under(s_sm_snowmath_mod, "Vec2", rb_cObject);
6542
- s_sm_vec3_klass = rb_define_class_under(s_sm_snowmath_mod, "Vec3", rb_cObject);
6543
- s_sm_vec4_klass = rb_define_class_under(s_sm_snowmath_mod, "Vec4", rb_cObject);
6544
- s_sm_quat_klass = rb_define_class_under(s_sm_snowmath_mod, "Quat", rb_cObject);
6545
- s_sm_mat3_klass = rb_define_class_under(s_sm_snowmath_mod, "Mat3", rb_cObject);
6546
- s_sm_mat4_klass = rb_define_class_under(s_sm_snowmath_mod, "Mat4", rb_cObject);
6544
+ s_sm_vec2_klass = rb_define_class_under(s_sm_snowmath_mod, "Vec2", rb_cData);
6545
+ s_sm_vec3_klass = rb_define_class_under(s_sm_snowmath_mod, "Vec3", rb_cData);
6546
+ s_sm_vec4_klass = rb_define_class_under(s_sm_snowmath_mod, "Vec4", rb_cData);
6547
+ s_sm_quat_klass = rb_define_class_under(s_sm_snowmath_mod, "Quat", rb_cData);
6548
+ s_sm_mat3_klass = rb_define_class_under(s_sm_snowmath_mod, "Mat3", rb_cData);
6549
+ s_sm_mat4_klass = rb_define_class_under(s_sm_snowmath_mod, "Mat4", rb_cData);
6547
6550
 
6548
6551
  rb_const_set(s_sm_snowmath_mod, kRB_CONST_FLOAT_SIZE, INT2FIX(sizeof(s_float_t)));
6549
6552
  rb_const_set(s_sm_vec2_klass, kRB_CONST_SIZE, INT2FIX(sizeof(vec2_t)));
@@ -6583,6 +6586,7 @@ void Init_bindings()
6583
6586
  rb_define_method(s_sm_vec2_klass, "scale", sm_vec2_scale, -1);
6584
6587
  rb_define_method(s_sm_vec2_klass, "divide", sm_vec2_divide, -1);
6585
6588
  rb_define_method(s_sm_vec2_klass, "==", sm_vec2_equals, 1);
6589
+ rb_alias(s_sm_vec2_klass, kRB_BYTESIZE_METHOD, kRB_SIZE_METHOD);
6586
6590
 
6587
6591
  rb_define_singleton_method(s_sm_vec3_klass, "new", sm_vec3_new, -1);
6588
6592
  rb_define_method(s_sm_vec3_klass, "initialize", sm_vec3_init, -1);
@@ -6609,6 +6613,7 @@ void Init_bindings()
6609
6613
  rb_define_method(s_sm_vec3_klass, "scale", sm_vec3_scale, -1);
6610
6614
  rb_define_method(s_sm_vec3_klass, "divide", sm_vec3_divide, -1);
6611
6615
  rb_define_method(s_sm_vec3_klass, "==", sm_vec3_equals, 1);
6616
+ rb_alias(s_sm_vec3_klass, kRB_BYTESIZE_METHOD, kRB_SIZE_METHOD);
6612
6617
 
6613
6618
  rb_define_singleton_method(s_sm_vec4_klass, "new", sm_vec4_new, -1);
6614
6619
  rb_define_method(s_sm_vec4_klass, "initialize", sm_vec4_init, -1);
@@ -6634,6 +6639,7 @@ void Init_bindings()
6634
6639
  rb_define_method(s_sm_vec4_klass, "scale", sm_vec4_scale, -1);
6635
6640
  rb_define_method(s_sm_vec4_klass, "divide", sm_vec4_divide, -1);
6636
6641
  rb_define_method(s_sm_vec4_klass, "==", sm_vec4_equals, 1);
6642
+ rb_alias(s_sm_vec4_klass, kRB_BYTESIZE_METHOD, kRB_SIZE_METHOD);
6637
6643
 
6638
6644
  rb_define_singleton_method(s_sm_quat_klass, "new", sm_quat_new, -1);
6639
6645
  rb_define_singleton_method(s_sm_quat_klass, "angle_axis", sm_quat_angle_axis, -1);
@@ -6662,6 +6668,7 @@ void Init_bindings()
6662
6668
  rb_define_method(s_sm_quat_klass, "magnitude_squared", sm_vec4_magnitude_squared, 0);
6663
6669
  rb_define_method(s_sm_quat_klass, "magnitude", sm_vec4_magnitude, 0);
6664
6670
  rb_define_method(s_sm_quat_klass, "==", sm_vec4_equals, 1);
6671
+ rb_alias(s_sm_quat_klass, kRB_BYTESIZE_METHOD, kRB_SIZE_METHOD);
6665
6672
 
6666
6673
  rb_define_singleton_method(s_sm_mat4_klass, "new", sm_mat4_new, -1);
6667
6674
  rb_define_singleton_method(s_sm_mat4_klass, "translation", sm_mat4_translation, -1);
@@ -6703,6 +6710,7 @@ void Init_bindings()
6703
6710
  rb_define_method(s_sm_mat4_klass, "get_column3", sm_mat4_get_column3, -1);
6704
6711
  rb_define_method(s_sm_mat4_klass, "get_column4", sm_mat4_get_column4, -1);
6705
6712
  rb_define_method(s_sm_mat4_klass, "==", sm_mat4_equals, 1);
6713
+ rb_alias(s_sm_mat4_klass, kRB_BYTESIZE_METHOD, kRB_SIZE_METHOD);
6706
6714
 
6707
6715
  rb_define_singleton_method(s_sm_mat3_klass, "new", sm_mat3_new, -1);
6708
6716
  rb_define_singleton_method(s_sm_mat3_klass, "angle_axis", sm_mat3_angle_axis, -1);
@@ -6732,10 +6740,11 @@ void Init_bindings()
6732
6740
  rb_define_method(s_sm_mat3_klass, "set_column3", sm_mat3_set_column3, 2);
6733
6741
  rb_define_method(s_sm_mat3_klass, "get_column3", sm_mat3_get_column3, -1);
6734
6742
  rb_define_method(s_sm_mat3_klass, "==", sm_mat3_equals, 1);
6743
+ rb_alias(s_sm_mat3_klass, kRB_BYTESIZE_METHOD, kRB_SIZE_METHOD);
6735
6744
 
6736
6745
  #if BUILD_ARRAY_TYPE
6737
6746
 
6738
- s_sm_vec2_array_klass = rb_define_class_under(s_sm_snowmath_mod, "Vec2Array", rb_cObject);
6747
+ s_sm_vec2_array_klass = rb_define_class_under(s_sm_snowmath_mod, "Vec2Array", rb_cData);
6739
6748
  rb_const_set(s_sm_vec2_array_klass, kRB_CONST_TYPE, s_sm_vec2_klass);
6740
6749
  rb_define_singleton_method(s_sm_vec2_array_klass, "new", sm_vec2_array_new, 1);
6741
6750
  rb_define_method(s_sm_vec2_array_klass, "fetch", sm_vec2_array_fetch, 1);
@@ -6744,8 +6753,9 @@ void Init_bindings()
6744
6753
  rb_define_method(s_sm_vec2_array_klass, "size", sm_vec2_array_size, 0);
6745
6754
  rb_define_method(s_sm_vec2_array_klass, "length", sm_mathtype_array_length, 0);
6746
6755
  rb_define_method(s_sm_vec2_array_klass, "address", sm_get_address, 0);
6756
+ rb_alias(s_sm_vec2_array_klass, kRB_BYTESIZE_METHOD, kRB_SIZE_METHOD);
6747
6757
 
6748
- s_sm_vec3_array_klass = rb_define_class_under(s_sm_snowmath_mod, "Vec3Array", rb_cObject);
6758
+ s_sm_vec3_array_klass = rb_define_class_under(s_sm_snowmath_mod, "Vec3Array", rb_cData);
6749
6759
  rb_const_set(s_sm_vec3_array_klass, kRB_CONST_TYPE, s_sm_vec3_klass);
6750
6760
  rb_define_singleton_method(s_sm_vec3_array_klass, "new", sm_vec3_array_new, 1);
6751
6761
  rb_define_method(s_sm_vec3_array_klass, "fetch", sm_vec3_array_fetch, 1);
@@ -6754,8 +6764,9 @@ void Init_bindings()
6754
6764
  rb_define_method(s_sm_vec3_array_klass, "size", sm_vec3_array_size, 0);
6755
6765
  rb_define_method(s_sm_vec3_array_klass, "length", sm_mathtype_array_length, 0);
6756
6766
  rb_define_method(s_sm_vec3_array_klass, "address", sm_get_address, 0);
6767
+ rb_alias(s_sm_vec3_array_klass, kRB_BYTESIZE_METHOD, kRB_SIZE_METHOD);
6757
6768
 
6758
- s_sm_vec4_array_klass = rb_define_class_under(s_sm_snowmath_mod, "Vec4Array", rb_cObject);
6769
+ s_sm_vec4_array_klass = rb_define_class_under(s_sm_snowmath_mod, "Vec4Array", rb_cData);
6759
6770
  rb_const_set(s_sm_vec4_array_klass, kRB_CONST_TYPE, s_sm_vec4_klass);
6760
6771
  rb_define_singleton_method(s_sm_vec4_array_klass, "new", sm_vec4_array_new, 1);
6761
6772
  rb_define_method(s_sm_vec4_array_klass, "fetch", sm_vec4_array_fetch, 1);
@@ -6764,8 +6775,9 @@ void Init_bindings()
6764
6775
  rb_define_method(s_sm_vec4_array_klass, "size", sm_vec4_array_size, 0);
6765
6776
  rb_define_method(s_sm_vec4_array_klass, "length", sm_mathtype_array_length, 0);
6766
6777
  rb_define_method(s_sm_vec4_array_klass, "address", sm_get_address, 0);
6778
+ rb_alias(s_sm_vec4_array_klass, kRB_BYTESIZE_METHOD, kRB_SIZE_METHOD);
6767
6779
 
6768
- s_sm_quat_array_klass = rb_define_class_under(s_sm_snowmath_mod, "QuatArray", rb_cObject);
6780
+ s_sm_quat_array_klass = rb_define_class_under(s_sm_snowmath_mod, "QuatArray", rb_cData);
6769
6781
  rb_const_set(s_sm_quat_array_klass, kRB_CONST_TYPE, s_sm_quat_klass);
6770
6782
  rb_define_singleton_method(s_sm_quat_array_klass, "new", sm_quat_array_new, 1);
6771
6783
  rb_define_method(s_sm_quat_array_klass, "fetch", sm_quat_array_fetch, 1);
@@ -6774,8 +6786,9 @@ void Init_bindings()
6774
6786
  rb_define_method(s_sm_quat_array_klass, "size", sm_quat_array_size, 0);
6775
6787
  rb_define_method(s_sm_quat_array_klass, "length", sm_mathtype_array_length, 0);
6776
6788
  rb_define_method(s_sm_quat_array_klass, "address", sm_get_address, 0);
6789
+ rb_alias(s_sm_quat_array_klass, kRB_BYTESIZE_METHOD, kRB_SIZE_METHOD);
6777
6790
 
6778
- s_sm_mat3_array_klass = rb_define_class_under(s_sm_snowmath_mod, "Mat3Array", rb_cObject);
6791
+ s_sm_mat3_array_klass = rb_define_class_under(s_sm_snowmath_mod, "Mat3Array", rb_cData);
6779
6792
  rb_const_set(s_sm_mat3_array_klass, kRB_CONST_TYPE, s_sm_mat3_klass);
6780
6793
  rb_define_singleton_method(s_sm_mat3_array_klass, "new", sm_mat3_array_new, 1);
6781
6794
  rb_define_method(s_sm_mat3_array_klass, "fetch", sm_mat3_array_fetch, 1);
@@ -6784,8 +6797,9 @@ void Init_bindings()
6784
6797
  rb_define_method(s_sm_mat3_array_klass, "size", sm_mat3_array_size, 0);
6785
6798
  rb_define_method(s_sm_mat3_array_klass, "length", sm_mathtype_array_length, 0);
6786
6799
  rb_define_method(s_sm_mat3_array_klass, "address", sm_get_address, 0);
6800
+ rb_alias(s_sm_mat3_array_klass, kRB_BYTESIZE_METHOD, kRB_SIZE_METHOD);
6787
6801
 
6788
- s_sm_mat4_array_klass = rb_define_class_under(s_sm_snowmath_mod, "Mat4Array", rb_cObject);
6802
+ s_sm_mat4_array_klass = rb_define_class_under(s_sm_snowmath_mod, "Mat4Array", rb_cData);
6789
6803
  rb_const_set(s_sm_mat4_array_klass, kRB_CONST_TYPE, s_sm_mat4_klass);
6790
6804
  rb_define_singleton_method(s_sm_mat4_array_klass, "new", sm_mat4_array_new, 1);
6791
6805
  rb_define_method(s_sm_mat4_array_klass, "fetch", sm_mat4_array_fetch, 1);
@@ -6794,6 +6808,7 @@ void Init_bindings()
6794
6808
  rb_define_method(s_sm_mat4_array_klass, "size", sm_mat4_array_size, 0);
6795
6809
  rb_define_method(s_sm_mat4_array_klass, "length", sm_mathtype_array_length, 0);
6796
6810
  rb_define_method(s_sm_mat4_array_klass, "address", sm_get_address, 0);
6811
+ rb_alias(s_sm_mat4_array_klass, kRB_BYTESIZE_METHOD, kRB_SIZE_METHOD);
6797
6812
 
6798
6813
  #endif
6799
6814
 
@@ -22,6 +22,6 @@ module Snow
22
22
  #
23
23
  # snow-math bindings version string.
24
24
  #
25
- SNOW_MATH_VERSION = '1.4.2'
25
+ SNOW_MATH_VERSION = '1.5.1'
26
26
 
27
27
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: snow-math
3
3
  version: !ruby/object:Gem::Version
4
- version: 1.4.2
4
+ version: 1.5.1
5
5
  platform: ruby
6
6
  authors:
7
7
  - Noel Raymond Cower
8
8
  autorequire:
9
9
  bindir: bin
10
10
  cert_chain: []
11
- date: 2013-07-10 00:00:00.000000000 Z
11
+ date: 2013-07-15 00:00:00.000000000 Z
12
12
  dependencies: []
13
13
  description: Math types built on the SnowPalm math code
14
14
  email: ncower@gmail.com
@@ -70,7 +70,7 @@ required_rubygems_version: !ruby/object:Gem::Requirement
70
70
  version: '0'
71
71
  requirements: []
72
72
  rubyforge_project:
73
- rubygems_version: 2.0.3
73
+ rubygems_version: 2.0.5
74
74
  signing_key:
75
75
  specification_version: 4
76
76
  summary: Snow Math Types