ruby-bullet 0.0.3-x86-linux → 0.1.0-x86-linux

Sign up to get free protection for your applications and to get access to all the features.
data/Gemfile ADDED
@@ -0,0 +1,4 @@
1
+ source 'https://rubygems.org'
2
+
3
+ # Specify your gem's dependencies in ruby-bullet.gemspec
4
+ gemspec
data/README.md CHANGED
@@ -1,39 +1,43 @@
1
- ruby-bullet
2
- =================
1
+ # ruby-bullet
3
2
 
4
- Overview
5
- ----
6
- Ruby-bullet is a ruby extension library of Bullet.
3
+ Ruby-bullet is a ruby binding for Bullet.
7
4
 
5
+ ## Installation
8
6
 
9
- Supported OS
10
- ------
11
- Linux(x86), Windows with MinGW(x86)
7
+ Add this line to your application's Gemfile:
12
8
 
9
+ gem 'ruby-bullet'
13
10
 
14
- How to install
15
- ----
16
- This project has a pre-compiled gem.
11
+ And then execute:
17
12
 
18
- $ sudo gem install pkg/ruby-bullet-<version>-<arch>.gem
13
+ $ bundle
19
14
 
15
+ Or install it yourself as:
16
+
17
+ $ gem install ruby-bullet
18
+
19
+ ## How to install from source.
20
+
21
+ If you want to compile from source, try the following.
22
+
23
+ $ git clone git://github.com/abexsoft/ruby-bullet.git
24
+ $ cd ruby-bullet
25
+ $ rake download
26
+ $ rake compile
27
+ $ rake build
28
+ $ gem build ruby-bullet.gemspec
29
+ $ gem install ruby-bullet-<version>-<arch>.gem
30
+
31
+ ## Usages
20
32
 
21
- Usages
22
- -----
23
33
  Run a sample application.
24
34
  The sample application uses gtk2 to draw boxes.
25
35
 
26
36
  $ sudo gem install gtk2
27
- $ ruby <gems_path>/ruby-bullet-<version>-<arch>/sample/hello_bullet/hello_bullet.rb
28
-
29
-
30
- How to compile
31
- ----
32
- see [INSTALL.md](https://github.com/abexsoft/ruby-bullet/blob/master/INSTALL.md)
37
+ $ <gems_path>/ruby-bullet-<version>-<arch>/sample/hello_bullet/run
33
38
 
39
+ ## License
34
40
 
35
- License
36
- ----------
37
41
  Ruby-bullet is licensed under MIT License.
38
42
 
39
43
  Copyright (C) 2012 abexsoft@gmail.com
data/Rakefile CHANGED
@@ -1,133 +1,72 @@
1
1
  require 'rubygems/package_task'
2
2
  require 'rake/clean'
3
3
 
4
- #
5
- # Download sources.
6
- #
7
4
  desc 'Download the source packages.'
8
- task :download => [:download_bullet]
9
-
10
- task :download_bullet do
11
- BULLET_FILE = "bullet-2.80-rev2531.tgz"
12
-
5
+ task :download do
13
6
  FileUtils::mkdir_p("deps/src")
14
7
  chdir('deps/src') {
8
+ BULLET_FILE = "bullet-2.80-rev2531.tgz"
15
9
  sh "wget http://bullet.googlecode.com/files/#{BULLET_FILE}"
16
10
  sh "tar xzvf #{BULLET_FILE}"
17
11
  }
18
12
  end
19
13
 
20
- #
21
- # Compile libraries.
22
- #
23
- namespace :compile do
24
-
25
- namespace :deps do
26
-
27
- task :bullet do
28
- chdir("deps/src/bullet-2.80-rev2531/") {
29
- if /mingw/ =~ RUBY_PLATFORM
30
- sh 'cmake . -G "MSYS Makefiles" -DUSE_GLUT:BOOL=OFF -DBUILD_DEMOS:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=..\
14
+ desc 'Compile bullet libraries.'
15
+ task :compile do
16
+ chdir("deps/src/bullet-2.80-rev2531/") {
17
+ if /mingw/ =~ RUBY_PLATFORM
18
+ sh 'cmake . -G "MSYS Makefiles" -DUSE_GLUT:BOOL=OFF -DBUILD_DEMOS:BOOL=OFF -DCMAKE_INSTALL_PREFIX:PATH=..\
31
19
  \.. -DINCLUDE_INSTALL_DIR:PATH=include\\bullet -DLIB_DESTINATION:STRING=..\\..\\lib -DPKGCONFIG_INSTALL_PR
32
20
  EFIX:STRING=..\\..\\lib\\pkgconfig\\'
33
- sh "make -j4"
34
- system('mkdir ..\..\lib')
35
- system('mkdir ..\..\include\bullet')
36
- sh "cp -a lib/*.a ../../lib"
37
- sh "cp -a src/* ../../include/bullet"
38
- else
39
- sh "cmake -DCMAKE_INSTALL_PREFIX:PATH=../.. -DINCLUDE_INSTALL_DIR:PATH=include/bullet -DLIB_DESTINATION:STRING=../../lib -DPKGCONFIG_INSTALL_PREFIX:STRING=../../lib/pkgconfig/"
40
- sh "make -j4 && make install"
41
- end
42
- }
21
+ sh "make -j4"
22
+ system('mkdir ..\..\lib')
23
+ system('mkdir ..\..\include\bullet')
24
+ sh "cp -a lib/*.a ../../lib"
25
+ sh "cp -a src/* ../../include/bullet"
26
+ else
27
+ sh "cmake -DCMAKE_INSTALL_PREFIX:PATH=../.. -DINCLUDE_INSTALL_DIR:PATH=include/bullet -DLIB_DESTINATION:STRING=../../lib -DPKGCONFIG_INSTALL_PREFIX:STRING=../../lib/pkgconfig/"
28
+ sh "make -j4 && make install"
43
29
  end
44
- end
45
- desc 'Compile a bullet library.'
46
- task :deps => 'deps:bullet'
47
-
48
-
49
- namespace :ext do
50
- #
51
- # Extension
52
- #
30
+ }
31
+ end
53
32
 
54
- DLEXT = RbConfig::MAKEFILE_CONFIG['DLEXT']
33
+ #
34
+ # Extension
35
+ #
55
36
 
56
- task :bullet => ["lib/bullet.#{DLEXT}"]
37
+ DLEXT = RbConfig::MAKEFILE_CONFIG['DLEXT']
57
38
 
58
- ## lib/*.#{DLEXT}
59
- file "lib/bullet.#{DLEXT}" => "bindings/bullet/bullet.#{DLEXT}" do |f|
60
- cp f.prerequisites, "lib/", :preserve => true
61
- end
39
+ desc 'Compile a bullet extension library.'
40
+ task :build => ["lib/bullet.#{DLEXT}"]
62
41
 
63
- ## ext/**/*.#{DLEXT}
64
- file "bindings/bullet/bullet.#{DLEXT}" => FileList["bindings/bullet/Makefile"] do |f|
65
- sh 'cd bindings/bullet/ && make clean && make'
66
- end
67
- CLEAN.include 'bindings/bullet/*.{o,so,dll}'
42
+ ## lib/*.#{DLEXT}
43
+ file "lib/bullet.#{DLEXT}" => "bindings/bullet/bullet.#{DLEXT}" do |f|
44
+ cp f.prerequisites, "lib/", :preserve => true
45
+ end
68
46
 
69
- ## ext/**/Makefile
70
- file 'bindings/bullet/Makefile' => FileList['bindings/bullet/interface/bullet_wrap.cpp'] do
71
- chdir('bindings/bullet/') { ruby 'extconf.rb' }
72
- end
73
- CLEAN.include 'bindings/bullet/Makefile'
47
+ ## ext/**/*.#{DLEXT}
48
+ file "bindings/bullet/bullet.#{DLEXT}" => FileList["bindings/bullet/Makefile"] do |f|
49
+ sh 'cd bindings/bullet/ && make clean && make'
50
+ end
51
+ CLEAN.include 'bindings/bullet/*.{o,so,dll}'
74
52
 
75
- ## make wrappers with swig.
76
- file 'bindings/bullet/interface/bullet_wrap.cpp' do
77
- chdir('bindings/bullet/interface') { sh 'rake' }
78
- end
79
- CLEAN.include 'bindings/bullet/interface/bullet_wrap.{cpp,h,o}'
80
- end
53
+ ## ext/**/Makefile
54
+ file 'bindings/bullet/Makefile' => FileList['bindings/bullet/interface/bullet_wrap.cpp'] do
55
+ chdir('bindings/bullet/') { ruby 'extconf.rb' }
56
+ end
57
+ CLEAN.include 'bindings/bullet/Makefile'
81
58
 
82
- desc 'Compile a bullet extension library.'
83
- task :ext => 'ext:bullet'
59
+ ## make wrappers with swig.
60
+ file 'bindings/bullet/interface/bullet_wrap.cpp' do
61
+ chdir('bindings/bullet/interface') { sh 'rake' }
84
62
  end
63
+ CLEAN.include 'bindings/bullet/interface/bullet_wrap.{cpp,h,o}'
85
64
 
86
65
  #
87
66
  # Document
88
67
  #
89
68
  desc 'Create documents'
90
69
  task :doc => ['bindings/bullet/interface/bullet_wrap.cpp'] do |f|
91
-
92
70
  sh "rdoc #{f.prerequisites.join(' ')}"
93
71
  end
94
72
 
95
- #
96
- # Gemspec
97
- #
98
- lib = File.expand_path('../lib', __FILE__)
99
- $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
100
- require 'version'
101
-
102
- spec = Gem::Specification.new do |s|
103
-
104
- s.name = "ruby-bullet"
105
- s.version = Ruby::Bullet::VERSION
106
- s.summary = "A ruby extension library of Bullet."
107
- s.homepage = "https://github.com/abexsoft/ruby-bullet"
108
- s.authors = ["abexsoft works"]
109
- s.email = ["abexsoft@gmail.com"]
110
- s.description = "This is a binary package of the ruby wrapper of Bullet."
111
- s.platform = Gem::Platform::CURRENT
112
-
113
- # The list of files to be contained in the gem
114
- s.files = FileList['Rakefile',
115
- 'README.md',
116
- 'INSTALL.md',
117
- 'LICENSE',
118
- 'bindings/bullet/interface/**/*',
119
- 'bindings/bullet/src/**/*',
120
- 'doc/**/*',
121
- 'lib/**/*',
122
- 'sample/**/*',
123
- 'deps/lib/*',
124
- 'deps/include/**/*',
125
- ].to_a
126
-
127
- # s.extra_rdoc_files = ['bindings/bullet/interface/bullet_wrap.cpp']
128
-
129
- s.require_paths = ["lib"]
130
- end
131
-
132
- Gem::PackageTask.new(spec) do |pkg|
133
- end
@@ -72,6 +72,8 @@ struct ContactResultCallback : public btCollisionWorld::ContactResultCallback
72
72
  #include <btCollisionWorld.h>
73
73
  %}
74
74
 
75
+ %freefunc btCollisionWorld "debug_free_BtCollisionWorld";
76
+
75
77
  %include btCollisionWorld.h
76
78
 
77
79
  %{
@@ -79,4 +81,15 @@ typedef btCollisionWorld::LocalRayResult LocalRayResult;
79
81
  typedef btCollisionWorld::RayResultCallback RayResultCallback;
80
82
  typedef btCollisionWorld::ClosestRayResultCallback ClosestRayResultCallback;
81
83
  typedef btCollisionWorld::ContactResultCallback ContactResultCallback;
84
+
85
+
86
+ static void debug_free_BtCollisionWorld(void* ptr) {
87
+ btCollisionWorld* obj = (btCollisionWorld*) ptr;
88
+
89
+ std::cout << __PRETTY_FUNCTION__ << std::endl;
90
+
91
+ delete obj;
92
+ }
93
+
94
+
82
95
  %}
@@ -2,9 +2,9 @@
2
2
  #include <btDiscreteDynamicsWorld.h>
3
3
  %}
4
4
 
5
- #ifdef DEBUG_FREEFUNC
5
+ //#ifdef DEBUG_FREEFUNC
6
6
  %freefunc btDiscreteDynamicsWorld "debug_free_btDiscreteDynamicsWorld";
7
- #endif
7
+ //#endif
8
8
 
9
9
  %include btDiscreteDynamicsWorld.h
10
10
 
@@ -7,9 +7,9 @@
7
7
 
8
8
  %feature("director") TickListener;
9
9
 
10
- #ifdef DEBUG_FREEFUNC
10
+ //#ifdef DEBUG_FREEFUNC
11
11
  %freefunc btDynamicsWorld "debug_free_BtDynamicsWorld";
12
- #endif
12
+ //#endif
13
13
 
14
14
  %include btDynamicsWorld.h
15
15
  %include "../../../src/TickListener.h"
@@ -17,9 +17,15 @@
17
17
  %extend btDynamicsWorld {
18
18
  void setInternalTickCallback(TickListener* listener, bool isPreTick=false) {
19
19
  if (isPreTick)
20
- self->setInternalTickCallback((btInternalTickCallback)TickListener::bulletPreTickCallback, listener, isPreTick);
20
+ self->setInternalTickCallback(
21
+ (btInternalTickCallback)TickListener::bulletPreTickCallback,
22
+ listener,
23
+ isPreTick);
21
24
  else
22
- self->setInternalTickCallback((btInternalTickCallback)TickListener::bulletTickCallback, listener, isPreTick);
25
+ self->setInternalTickCallback(
26
+ (btInternalTickCallback)TickListener::bulletTickCallback,
27
+ listener,
28
+ isPreTick);
23
29
  }
24
30
  }
25
31
 
@@ -2,7 +2,6 @@
2
2
  #include <btVector3.h>
3
3
  %}
4
4
 
5
-
6
5
  %rename("x") btVector3::getX();
7
6
  %rename("x=") btVector3::setX(btScalar value);
8
7
  %rename("y") btVector3::getY();
@@ -1,10 +1,7 @@
1
- SWIG = 'swig'
2
-
3
- DEPS_DIR = "../../../deps/"
4
- load "../../../deps/env.rb"
1
+ require_relative "../../../lib/ruby-bullet"
5
2
 
6
-
7
- SWIGFLAGS = "-ruby -c++ -w801 #{BULLET_INC} -I../src/ -autorename"
3
+ SWIG = 'swig'
4
+ SWIGFLAGS = "-ruby -c++ -w801 #{Ruby::Bullet::get_inc_flags} -I../src/ -autorename"
8
5
 
9
6
  TARGET = 'bullet_wrap.cpp'
10
7
 
@@ -3686,6 +3686,17 @@ typedef btCollisionWorld::ClosestRayResultCallback ClosestRayResultCallback;
3686
3686
  typedef btCollisionWorld::ContactResultCallback ContactResultCallback;
3687
3687
 
3688
3688
 
3689
+ static void debug_free_BtCollisionWorld(void* ptr) {
3690
+ btCollisionWorld* obj = (btCollisionWorld*) ptr;
3691
+
3692
+ std::cout << __PRETTY_FUNCTION__ << std::endl;
3693
+
3694
+ delete obj;
3695
+ }
3696
+
3697
+
3698
+
3699
+
3689
3700
  #include <btActivatingCollisionAlgorithm.h>
3690
3701
 
3691
3702
 
@@ -3962,9 +3973,15 @@ SWIG_From_size_t (size_t value)
3962
3973
 
3963
3974
  SWIGINTERN void btDynamicsWorld_setInternalTickCallback__SWIG_3(btDynamicsWorld *self,TickListener *listener,bool isPreTick=false){
3964
3975
  if (isPreTick)
3965
- self->setInternalTickCallback((btInternalTickCallback)TickListener::bulletPreTickCallback, listener, isPreTick);
3976
+ self->setInternalTickCallback(
3977
+ (btInternalTickCallback)TickListener::bulletPreTickCallback,
3978
+ listener,
3979
+ isPreTick);
3966
3980
  else
3967
- self->setInternalTickCallback((btInternalTickCallback)TickListener::bulletTickCallback, listener, isPreTick);
3981
+ self->setInternalTickCallback(
3982
+ (btInternalTickCallback)TickListener::bulletTickCallback,
3983
+ listener,
3984
+ isPreTick);
3968
3985
  }
3969
3986
 
3970
3987
 
@@ -96522,11 +96539,6 @@ fail:
96522
96539
  }
96523
96540
 
96524
96541
 
96525
- SWIGINTERN void
96526
- free_btCollisionWorld(btCollisionWorld *arg1) {
96527
- delete arg1;
96528
- }
96529
-
96530
96542
  SWIGINTERN VALUE
96531
96543
  _wrap_BtCollisionWorld_set_broadphase(int argc, VALUE *argv, VALUE self) {
96532
96544
  btCollisionWorld *arg1 = (btCollisionWorld *) 0 ;
@@ -150777,11 +150789,6 @@ fail:
150777
150789
 
150778
150790
  swig_class SwigClassBtDynamicsWorld;
150779
150791
 
150780
- SWIGINTERN void
150781
- free_btDynamicsWorld(btDynamicsWorld *arg1) {
150782
- delete arg1;
150783
- }
150784
-
150785
150792
  SWIGINTERN VALUE
150786
150793
  _wrap_BtDynamicsWorld_step_simulation__SWIG_0(int argc, VALUE *argv, VALUE self) {
150787
150794
  btDynamicsWorld *arg1 = (btDynamicsWorld *) 0 ;
@@ -152453,11 +152460,6 @@ fail:
152453
152460
  }
152454
152461
 
152455
152462
 
152456
- SWIGINTERN void
152457
- free_btDiscreteDynamicsWorld(btDiscreteDynamicsWorld *arg1) {
152458
- delete arg1;
152459
- }
152460
-
152461
152463
  SWIGINTERN VALUE
152462
152464
  _wrap_BtDiscreteDynamicsWorld_step_simulation__SWIG_0(int argc, VALUE *argv, VALUE self) {
152463
152465
  btDiscreteDynamicsWorld *arg1 = (btDiscreteDynamicsWorld *) 0 ;
@@ -191085,7 +191087,7 @@ SWIGEXPORT void Init_bullet(void) {
191085
191087
  rb_define_method(SwigClassBtCollisionWorld.klass, "set_force_update_all_aabbs", VALUEFUNC(_wrap_BtCollisionWorld_set_force_update_all_aabbs), -1);
191086
191088
  rb_define_method(SwigClassBtCollisionWorld.klass, "serialize", VALUEFUNC(_wrap_BtCollisionWorld_serialize), -1);
191087
191089
  SwigClassBtCollisionWorld.mark = 0;
191088
- SwigClassBtCollisionWorld.destroy = (void (*)(void *)) free_btCollisionWorld;
191090
+ SwigClassBtCollisionWorld.destroy = (void (*)(void *)) debug_free_BtCollisionWorld;
191089
191091
  SwigClassBtCollisionWorld.trackObjects = 0;
191090
191092
 
191091
191093
  SwigClassBtActivatingCollisionAlgorithm.klass = rb_define_class_under(mBullet, "BtActivatingCollisionAlgorithm", ((swig_class *) SWIGTYPE_p_btCollisionAlgorithm->clientdata)->klass);
@@ -193121,7 +193123,7 @@ SWIGEXPORT void Init_bullet(void) {
193121
193123
  rb_define_method(SwigClassBtDynamicsWorld.klass, "remove_character", VALUEFUNC(_wrap_BtDynamicsWorld_remove_character), -1);
193122
193124
  rb_define_method(SwigClassBtDynamicsWorld.klass, "set_internal_tick_callback", VALUEFUNC(_wrap_BtDynamicsWorld_set_internal_tick_callback), -1);
193123
193125
  SwigClassBtDynamicsWorld.mark = 0;
193124
- SwigClassBtDynamicsWorld.destroy = (void (*)(void *)) free_btDynamicsWorld;
193126
+ SwigClassBtDynamicsWorld.destroy = (void (*)(void *)) debug_free_BtDynamicsWorld;
193125
193127
  SwigClassBtDynamicsWorld.trackObjects = 0;
193126
193128
  rb_define_module_function(mBullet, "disown_TickListener", VALUEFUNC(_wrap_disown_TickListener), -1);
193127
193129
 
@@ -193175,7 +193177,7 @@ SWIGEXPORT void Init_bullet(void) {
193175
193177
  rb_define_method(SwigClassBtDiscreteDynamicsWorld.klass, "get_synchronize_all_motion_states", VALUEFUNC(_wrap_BtDiscreteDynamicsWorld_get_synchronize_all_motion_states), -1);
193176
193178
  rb_define_method(SwigClassBtDiscreteDynamicsWorld.klass, "serialize", VALUEFUNC(_wrap_BtDiscreteDynamicsWorld_serialize), -1);
193177
193179
  SwigClassBtDiscreteDynamicsWorld.mark = 0;
193178
- SwigClassBtDiscreteDynamicsWorld.destroy = (void (*)(void *)) free_btDiscreteDynamicsWorld;
193180
+ SwigClassBtDiscreteDynamicsWorld.destroy = (void (*)(void *)) debug_free_btDiscreteDynamicsWorld;
193179
193181
  SwigClassBtDiscreteDynamicsWorld.trackObjects = 0;
193180
193182
 
193181
193183
  SwigClassBtSimpleDynamicsWorld.klass = rb_define_class_under(mBullet, "BtSimpleDynamicsWorld", ((swig_class *) SWIGTYPE_p_btDynamicsWorld->clientdata)->klass);
Binary file
Binary file
Binary file
Binary file
Binary file
data/deps/lib/libMiniCL.a CHANGED
Binary file
data/lib/bullet.so CHANGED
Binary file
@@ -0,0 +1,5 @@
1
+ module Ruby
2
+ module Bullet
3
+ VERSION = "0.1.0"
4
+ end
5
+ end
@@ -0,0 +1,36 @@
1
+ require_relative "ruby-bullet/version"
2
+
3
+ module Ruby
4
+ module Bullet
5
+ def self.get_top_path
6
+ File.dirname(File.dirname(File.expand_path(__FILE__)))
7
+ end
8
+
9
+ def self.get_deps_lib_path
10
+ "#{get_top_path}/deps/lib"
11
+ end
12
+
13
+ def self.get_deps_inc_path
14
+ "#{get_top_path()}/deps/include/"
15
+ end
16
+
17
+ def self.get_inc_flags
18
+ " -I#{get_top_path}/deps/include/bullet/ " +
19
+ " -I#{get_top_path}/deps/include/bullet/LinearMath/ " +
20
+ " -I#{get_top_path}/deps/include/bullet/BulletCollision/CollisionDispatch/ " +
21
+ " -I#{get_top_path}/deps/include/bullet/BulletCollision/BroadphaseCollision/ " +
22
+ " -I#{get_top_path}/deps/include/bullet/BulletCollision/NarrowPhaseCollision/ " +
23
+ " -I#{get_top_path}/deps/include/bullet/BulletCollision/CollisionShapes/ " +
24
+ " -I#{get_top_path}/deps/include/bullet/BulletCollision/Gimpact/ " +
25
+ " -I#{get_top_path}/deps/include/bullet/BulletDynamics/ConstraintSolver/ " +
26
+ " -I#{get_top_path}/deps/include/bullet/BulletDynamics/Dynamics/ " +
27
+ " -I#{get_top_path}/deps/include/bullet/BulletDynamics/Vehicle/ " +
28
+ " -I#{get_top_path}/deps/include/bullet/BulletDynamics/Character/ " +
29
+ " -I#{get_top_path}/deps/include/bullet/BulletSoftBody/ "
30
+ end
31
+
32
+ def self.get_lib_flags
33
+ "-L#{get_top_path}/deps/lib -lBulletDynamics -lBulletCollision -lBulletSoftBody -lLinearMath"
34
+ end
35
+ end
36
+ end
data/lib/version.rb CHANGED
@@ -1,5 +1,5 @@
1
1
  module Ruby
2
2
  module Bullet
3
- VERSION = "0.0.3"
3
+ VERSION = "0.0.4"
4
4
  end
5
5
  end
@@ -0,0 +1,33 @@
1
+ lib = File.expand_path('../lib', __FILE__)
2
+ $LOAD_PATH.unshift(lib) unless $LOAD_PATH.include?(lib)
3
+ require 'ruby-bullet/version'
4
+
5
+ Gem::Specification.new do |gem|
6
+ gem.name = "ruby-bullet"
7
+ gem.version = Ruby::Bullet::VERSION
8
+ gem.authors = ["abexsoft"]
9
+ gem.email = ["abexsoft@gmail.com"]
10
+ gem.summary = %q{A ruby binding for Bullet.}
11
+ gem.description = %q{A ruby binding for Bullet.}
12
+ gem.homepage = "https://github.com/abexsoft/ruby-bullet"
13
+ gem.platform = Gem::Platform::CURRENT
14
+
15
+ gem.files = Dir['Gemfile',
16
+ 'Rakefile',
17
+ 'README.md',
18
+ 'INSTALL.md',
19
+ 'LICENSE',
20
+ 'ruby-bullet.gemspec',
21
+ 'bindings/bullet/interface/**/*',
22
+ 'bindings/bullet/src/**/*',
23
+ 'doc/**/*',
24
+ 'lib/**/*',
25
+ 'sample/**/*',
26
+ 'deps/lib/*',
27
+ 'deps/include/**/*',
28
+ ]
29
+
30
+ gem.executables = gem.files.grep(%r{^bin/}).map{ |f| File.basename(f) }
31
+ gem.test_files = gem.files.grep(%r{^(test|spec|features)/})
32
+ gem.require_paths = ["lib"]
33
+ end
@@ -2,7 +2,7 @@ $LOAD_PATH.push(File.dirname(File.expand_path(__FILE__)) + "/../../lib")
2
2
 
3
3
  require 'gtk2'
4
4
  require 'cairo'
5
- require "bullet.so"
5
+ require "bullet"
6
6
 
7
7
  class Physics
8
8
  attr_accessor :context
@@ -51,6 +51,14 @@ class Physics
51
51
 
52
52
  return delta
53
53
  end
54
+
55
+ def finalize()
56
+ # patch for GC.
57
+ @objects.each{|body|
58
+ @dynamicsWorld.remove_rigid_body(body.rigidBody)
59
+ }
60
+ @objects = []
61
+ end
54
62
  end
55
63
 
56
64
 
@@ -137,6 +145,7 @@ physics.add_object(floor)
137
145
  window = Gtk::Window.new
138
146
  window.set_default_size(300, 300)
139
147
  window.signal_connect("destroy") do
148
+ physics.finalize
140
149
  Gtk.main_quit
141
150
  false
142
151
  end
@@ -0,0 +1,6 @@
1
+ #!/bin/sh
2
+
3
+ FILE_PATH=`dirname "$0"`
4
+ DEPS_PATH=$FILE_PATH/../../deps
5
+
6
+ LD_LIBRARY_PATH=${DEPS_PATH}/lib:$LD_LIBRARY_PATH ruby $FILE_PATH/hello_bullet.rb
metadata CHANGED
@@ -1,27 +1,28 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-bullet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.1.0
5
5
  prerelease:
6
6
  platform: x86-linux
7
7
  authors:
8
- - abexsoft works
8
+ - abexsoft
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-02 00:00:00.000000000 Z
12
+ date: 2013-02-24 00:00:00.000000000 Z
13
13
  dependencies: []
14
- description: This is a binary package of the ruby wrapper of Bullet.
14
+ description: A ruby binding for Bullet.
15
15
  email:
16
16
  - abexsoft@gmail.com
17
17
  executables: []
18
18
  extensions: []
19
19
  extra_rdoc_files: []
20
20
  files:
21
+ - Gemfile
21
22
  - Rakefile
22
23
  - README.md
23
- - INSTALL.md
24
24
  - LICENSE
25
+ - ruby-bullet.gemspec
25
26
  - bindings/bullet/interface/bullet.i
26
27
  - bindings/bullet/interface/BulletSoftBody/btSoftBodyConcaveCollisionAlgorithm.i
27
28
  - bindings/bullet/interface/BulletSoftBody/btSoftRigidDynamicsWorld.i
@@ -200,9 +201,12 @@ files:
200
201
  - bindings/bullet/interface/Rakefile
201
202
  - bindings/bullet/interface/bullet_all.i
202
203
  - bindings/bullet/src/TickListener.h
203
- - lib/bullet_config.rb
204
+ - lib/ruby-bullet.rb
204
205
  - lib/version.rb
206
+ - lib/ruby-bullet/version.rb
205
207
  - lib/bullet.so
208
+ - lib/_obsoleted/bullet_config.rb
209
+ - sample/hello_bullet/run
206
210
  - sample/hello_bullet/hello_bullet.rb
207
211
  - deps/lib/libBulletMultiThreaded.a
208
212
  - deps/lib/libBulletSoftBody.a
@@ -500,5 +504,5 @@ rubyforge_project:
500
504
  rubygems_version: 1.8.11
501
505
  signing_key:
502
506
  specification_version: 3
503
- summary: A ruby extension library of Bullet.
507
+ summary: A ruby binding for Bullet.
504
508
  test_files: []
data/INSTALL.md DELETED
@@ -1,22 +0,0 @@
1
- Using libraries
2
- --------------
3
- * ruby : http://www.ruby-lang.org/
4
- * swig : http://www.swig.org/
5
- * bullet : http://bulletphysics.org/
6
-
7
-
8
- How to compile all libraries.
9
- --------------
10
- 1. compile external libraries.
11
-
12
- > $ rake download
13
- > $ rake compile:deps
14
-
15
- 2. make ruby extension libraries.
16
-
17
- > $ rake compile:ext
18
-
19
- 3. install ruby extension libraries.
20
-
21
- > $ rake package
22
- > $ sudo gem install pkg/ruby-bullet-\<version>-\<arch>.gem