rmath3d 1.0.1 → 1.0.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.
- checksums.yaml +4 -4
- data/ChangeLog +8 -0
- data/LICENSE.txt +1 -1
- data/README.md +8 -4
- data/ext/rmath3d/RMath3D.h +0 -0
- data/ext/rmath3d/RType.h +0 -0
- data/ext/rmath3d/rmath3d.c +40 -10
- data/test/test.rb +5 -2
- metadata +15 -16
- data/Gemfile +0 -2
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
2
|
SHA1:
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
3
|
+
metadata.gz: 2fa4b132536ee9bcbe0c7da9e51fe53bd566010e
|
4
|
+
data.tar.gz: 17eee04a0ac050c85fbc1953d7302ff7f41e1d06
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: 9bfefb8f3a0a41f88c8e25fa3074d1b45a05a2be87085c6759029b7566362188c65d41261254b7afacaab22c1fdc221b2e50bccac6097ca36e2e42089cc167d6
|
7
|
+
data.tar.gz: ac604ce99ae372569cdf291ae09166dc4c67f8d9e86f970bfe6da7b2967ebe6e57ac652dcd0f1a07f222d9801a348df8d5372c6dc5d6d395ea291dfc9d08ec5c
|
data/ChangeLog
CHANGED
@@ -1,3 +1,11 @@
|
|
1
|
+
2014-05-17 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
|
+
|
3
|
+
* ext/rmath3d/rmath3d.c: Fixed memory management
|
4
|
+
|
5
|
+
2013-10-26 vaiorabbit <http://twitter.com/vaiorabbit>
|
6
|
+
|
7
|
+
* rmath3d_plain.gemspec: Packs pure ruby implementation into 'rmath3d_plain-X.Y.Z.gem'.
|
8
|
+
|
1
9
|
2013-09-21 vaiorabbit <http://twitter.com/vaiorabbit>
|
2
10
|
|
3
11
|
* README.txt: Updated tested environment and information about building native extension.
|
data/LICENSE.txt
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
rmath3d : Ruby math module for 3D Applications
|
2
|
-
Copyright (c) 2008- vaiorabbit <http://twitter.com/vaiorabbit>
|
2
|
+
Copyright (c) 2008-2014 vaiorabbit <http://twitter.com/vaiorabbit>
|
3
3
|
|
4
4
|
This software is provided 'as-is', without any express or implied
|
5
5
|
warranty. In no event will the authors be held liable for any damages
|
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:
|
7
|
+
* Last Update: May 17, 2014
|
8
8
|
* Since: Jul 20, 2008
|
9
9
|
|
10
10
|
## Features ##
|
@@ -36,9 +36,13 @@ Notice: This library provides native extension. You must setup develop environme
|
|
36
36
|
|
37
37
|
## Building rmath3d.{so|bundle} ##
|
38
38
|
|
39
|
-
Via RubyGems ( https://rubygems.org/gems/
|
39
|
+
Via RubyGems ( https://rubygems.org/gems/rmath3d ):
|
40
40
|
|
41
|
-
$ gem install
|
41
|
+
$ gem install rmath3d
|
42
|
+
|
43
|
+
for pure ruby version:
|
44
|
+
|
45
|
+
$ gem install rmath3d_plain
|
42
46
|
|
43
47
|
### From source package ###
|
44
48
|
|
@@ -163,7 +167,7 @@ Currently, there is no combenient way to convert between matrix.rb's
|
|
163
167
|
## Information ##
|
164
168
|
|
165
169
|
* RubyGems
|
166
|
-
* https://rubygems.org/gems/
|
170
|
+
* https://rubygems.org/gems/rmath3d
|
167
171
|
* Github
|
168
172
|
* https://github.com/vaiorabbit/rmath3d
|
169
173
|
|
data/ext/rmath3d/RMath3D.h
CHANGED
File without changes
|
data/ext/rmath3d/RType.h
CHANGED
File without changes
|
data/ext/rmath3d/rmath3d.c
CHANGED
@@ -73,6 +73,12 @@ static VALUE RVec4_from_source( RVec4* src );
|
|
73
73
|
* * elements are stored in column-major order.
|
74
74
|
*/
|
75
75
|
|
76
|
+
static void
|
77
|
+
RMtx3_free( void* ptr )
|
78
|
+
{
|
79
|
+
xfree( ptr );
|
80
|
+
}
|
81
|
+
|
76
82
|
static VALUE
|
77
83
|
RMtx3_from_source( RMtx3* src )
|
78
84
|
{
|
@@ -80,7 +86,7 @@ RMtx3_from_source( RMtx3* src )
|
|
80
86
|
|
81
87
|
RMtx3Copy( v, src );
|
82
88
|
|
83
|
-
return Data_Wrap_Struct( rb_cRMtx3,
|
89
|
+
return Data_Wrap_Struct( rb_cRMtx3, NULL, RMtx3_free, v );
|
84
90
|
}
|
85
91
|
|
86
92
|
|
@@ -91,7 +97,7 @@ RMtx3_allocate( VALUE klass )
|
|
91
97
|
|
92
98
|
memset( v, 0, sizeof(RMtx3) );
|
93
99
|
|
94
|
-
return Data_Wrap_Struct( klass,
|
100
|
+
return Data_Wrap_Struct( klass, NULL, RMtx3_free, v );
|
95
101
|
}
|
96
102
|
|
97
103
|
|
@@ -1190,6 +1196,12 @@ RMtx3_op_assign_mult( VALUE self, VALUE other )
|
|
1190
1196
|
* * elements are stored in column-major order.
|
1191
1197
|
*/
|
1192
1198
|
|
1199
|
+
static void
|
1200
|
+
RMtx4_free( void* ptr )
|
1201
|
+
{
|
1202
|
+
xfree( ptr );
|
1203
|
+
}
|
1204
|
+
|
1193
1205
|
static VALUE
|
1194
1206
|
RMtx4_from_source( RMtx4* src )
|
1195
1207
|
{
|
@@ -1197,7 +1209,7 @@ RMtx4_from_source( RMtx4* src )
|
|
1197
1209
|
|
1198
1210
|
RMtx4Copy( v, src );
|
1199
1211
|
|
1200
|
-
return Data_Wrap_Struct( rb_cRMtx4,
|
1212
|
+
return Data_Wrap_Struct( rb_cRMtx4, NULL, RMtx4_free, v );
|
1201
1213
|
}
|
1202
1214
|
|
1203
1215
|
|
@@ -1208,7 +1220,7 @@ RMtx4_allocate( VALUE klass )
|
|
1208
1220
|
|
1209
1221
|
memset( v, 0, sizeof(RMtx4) );
|
1210
1222
|
|
1211
|
-
return Data_Wrap_Struct( klass,
|
1223
|
+
return Data_Wrap_Struct( klass, NULL, RMtx4_free, v );
|
1212
1224
|
}
|
1213
1225
|
|
1214
1226
|
|
@@ -2735,6 +2747,12 @@ RMtx4_op_assign_mult( VALUE self, VALUE other )
|
|
2735
2747
|
* provies quaternion arithmetic.
|
2736
2748
|
*/
|
2737
2749
|
|
2750
|
+
static void
|
2751
|
+
RQuat_free( void* ptr )
|
2752
|
+
{
|
2753
|
+
xfree( ptr );
|
2754
|
+
}
|
2755
|
+
|
2738
2756
|
static VALUE
|
2739
2757
|
RQuat_from_source( RQuat* src )
|
2740
2758
|
{
|
@@ -2742,7 +2760,7 @@ RQuat_from_source( RQuat* src )
|
|
2742
2760
|
|
2743
2761
|
RQuatCopy( v, src );
|
2744
2762
|
|
2745
|
-
return Data_Wrap_Struct( rb_cRQuat,
|
2763
|
+
return Data_Wrap_Struct( rb_cRQuat, NULL, RQuat_free, v );
|
2746
2764
|
}
|
2747
2765
|
|
2748
2766
|
|
@@ -2753,7 +2771,7 @@ RQuat_allocate( VALUE klass )
|
|
2753
2771
|
|
2754
2772
|
memset( v, 0, sizeof(RQuat) );
|
2755
2773
|
|
2756
|
-
return Data_Wrap_Struct( klass,
|
2774
|
+
return Data_Wrap_Struct( klass, NULL, RQuat_free, v );
|
2757
2775
|
}
|
2758
2776
|
|
2759
2777
|
|
@@ -3732,6 +3750,12 @@ RQuat_toAxisAngle( VALUE self )
|
|
3732
3750
|
* provies 3 element vector arithmetic.
|
3733
3751
|
*/
|
3734
3752
|
|
3753
|
+
static void
|
3754
|
+
RVec3_free( void* ptr )
|
3755
|
+
{
|
3756
|
+
xfree( ptr );
|
3757
|
+
}
|
3758
|
+
|
3735
3759
|
static VALUE
|
3736
3760
|
RVec3_from_source( RVec3* src )
|
3737
3761
|
{
|
@@ -3739,7 +3763,7 @@ RVec3_from_source( RVec3* src )
|
|
3739
3763
|
|
3740
3764
|
RVec3Copy( v, src );
|
3741
3765
|
|
3742
|
-
return Data_Wrap_Struct( rb_cRVec3,
|
3766
|
+
return Data_Wrap_Struct( rb_cRVec3, NULL, RVec3_free, v );
|
3743
3767
|
}
|
3744
3768
|
|
3745
3769
|
|
@@ -3750,7 +3774,7 @@ RVec3_allocate( VALUE klass )
|
|
3750
3774
|
|
3751
3775
|
memset( v, 0, sizeof(RVec3) );
|
3752
3776
|
|
3753
|
-
return Data_Wrap_Struct( klass,
|
3777
|
+
return Data_Wrap_Struct( klass, NULL, RVec3_free, v );
|
3754
3778
|
}
|
3755
3779
|
|
3756
3780
|
|
@@ -4726,6 +4750,12 @@ RVec3_op_assign_mult( VALUE self, VALUE other )
|
|
4726
4750
|
* provies 4 element vector arithmetic.
|
4727
4751
|
*/
|
4728
4752
|
|
4753
|
+
static void
|
4754
|
+
RVec4_free( void* ptr )
|
4755
|
+
{
|
4756
|
+
xfree( ptr );
|
4757
|
+
}
|
4758
|
+
|
4729
4759
|
static VALUE
|
4730
4760
|
RVec4_from_source( RVec4* src )
|
4731
4761
|
{
|
@@ -4733,7 +4763,7 @@ RVec4_from_source( RVec4* src )
|
|
4733
4763
|
|
4734
4764
|
RVec4Copy( v, src );
|
4735
4765
|
|
4736
|
-
return Data_Wrap_Struct( rb_cRVec4,
|
4766
|
+
return Data_Wrap_Struct( rb_cRVec4, NULL, RVec4_free, v );
|
4737
4767
|
}
|
4738
4768
|
|
4739
4769
|
|
@@ -4744,7 +4774,7 @@ RVec4_allocate( VALUE klass )
|
|
4744
4774
|
|
4745
4775
|
memset( v, 0, sizeof(RVec4) );
|
4746
4776
|
|
4747
|
-
return Data_Wrap_Struct( klass,
|
4777
|
+
return Data_Wrap_Struct( klass, NULL, RVec4_free, v );
|
4748
4778
|
}
|
4749
4779
|
|
4750
4780
|
|
data/test/test.rb
CHANGED
@@ -1,6 +1,9 @@
|
|
1
|
-
|
1
|
+
begin
|
2
|
+
require 'rmath3d/rmath3d'
|
3
|
+
rescue LoadError
|
4
|
+
require 'rmath3d/rmath3d_plain'
|
5
|
+
end
|
2
6
|
# require_relative '../ext/rmath3d/rmath3d'
|
3
|
-
# require 'rmath3d/rmath3d_plain'
|
4
7
|
# require_relative '../lib/rmath3d/rmath3d_plain'
|
5
8
|
include RMath3D
|
6
9
|
|
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.0.
|
4
|
+
version: 1.0.2
|
5
5
|
platform: ruby
|
6
6
|
authors:
|
7
7
|
- vaiorabbit
|
8
8
|
autorequire:
|
9
9
|
bindir: bin
|
10
10
|
cert_chain: []
|
11
|
-
date:
|
11
|
+
date: 2014-05-18 00:00:00.000000000 Z
|
12
12
|
dependencies: []
|
13
13
|
description: |
|
14
14
|
Provides vector3/4, matrix3x3/4x4 and quaternion in C extension library form (and plain Ruby form with the same interface for debugging use).
|
@@ -20,20 +20,24 @@ extensions:
|
|
20
20
|
- ext/rmath3d/extconf.rb
|
21
21
|
extra_rdoc_files: []
|
22
22
|
files:
|
23
|
-
-
|
24
|
-
-
|
25
|
-
-
|
26
|
-
-
|
27
|
-
- ext/rmath3d/RVec3.c
|
28
|
-
- ext/rmath3d/RVec4.c
|
23
|
+
- ChangeLog
|
24
|
+
- LICENSE.txt
|
25
|
+
- README.md
|
26
|
+
- Rakefile
|
29
27
|
- ext/rmath3d/RMath3D.h
|
28
|
+
- ext/rmath3d/RMtx3.c
|
30
29
|
- ext/rmath3d/RMtx3.h
|
30
|
+
- ext/rmath3d/RMtx4.c
|
31
31
|
- ext/rmath3d/RMtx4.h
|
32
|
+
- ext/rmath3d/RQuat.c
|
32
33
|
- ext/rmath3d/RQuat.h
|
33
34
|
- ext/rmath3d/RType.h
|
35
|
+
- ext/rmath3d/RVec3.c
|
34
36
|
- ext/rmath3d/RVec3.h
|
37
|
+
- ext/rmath3d/RVec4.c
|
35
38
|
- ext/rmath3d/RVec4.h
|
36
39
|
- ext/rmath3d/extconf.rb
|
40
|
+
- ext/rmath3d/rmath3d.c
|
37
41
|
- lib/rmath3d/rmath3d_plain.rb
|
38
42
|
- sample/opengl-bindings/load_matrix.rb
|
39
43
|
- sample/opengl2/load_matrix.rb
|
@@ -44,11 +48,6 @@ files:
|
|
44
48
|
- test/test_RQuat.rb
|
45
49
|
- test/test_RVec3.rb
|
46
50
|
- test/test_RVec4.rb
|
47
|
-
- ChangeLog
|
48
|
-
- LICENSE.txt
|
49
|
-
- README.md
|
50
|
-
- Rakefile
|
51
|
-
- Gemfile
|
52
51
|
homepage: https://github.com/vaiorabbit/rmath3d
|
53
52
|
licenses:
|
54
53
|
- zlib/libpng
|
@@ -59,17 +58,17 @@ require_paths:
|
|
59
58
|
- lib
|
60
59
|
required_ruby_version: !ruby/object:Gem::Requirement
|
61
60
|
requirements:
|
62
|
-
- -
|
61
|
+
- - ">="
|
63
62
|
- !ruby/object:Gem::Version
|
64
63
|
version: '0'
|
65
64
|
required_rubygems_version: !ruby/object:Gem::Requirement
|
66
65
|
requirements:
|
67
|
-
- -
|
66
|
+
- - ">="
|
68
67
|
- !ruby/object:Gem::Version
|
69
68
|
version: '0'
|
70
69
|
requirements: []
|
71
70
|
rubyforge_project:
|
72
|
-
rubygems_version: 2.
|
71
|
+
rubygems_version: 2.2.2
|
73
72
|
signing_key:
|
74
73
|
specification_version: 4
|
75
74
|
summary: Ruby Math Module for 3D Applications
|
data/Gemfile
DELETED