teienlib 0.0.3-x86-linux → 0.0.4-x86-linux

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.
@@ -1,3 +1,3 @@
1
1
  module Teienlib
2
- VERSION = "0.0.3"
2
+ VERSION = "0.0.4"
3
3
  end
data/lib/teienlib.so CHANGED
Binary file
data/sample/hello/box.rb CHANGED
@@ -2,6 +2,7 @@ class Box < Bullet::BtMotionState
2
2
  @@cnt = 0
3
3
 
4
4
  attr_accessor :id
5
+ attr_accessor :rigid_body
5
6
 
6
7
  def initialize(dynamics_world, scene_mgr, mass, x, y, z, color)
7
8
  super() # needed by Bullet::BtMotionState
@@ -1,4 +1,6 @@
1
1
  class Floor < Bullet::BtMotionState
2
+ attr_accessor :rigid_body
3
+
2
4
  def initialize(dynamicsWorld, sceneMgr)
3
5
  super()
4
6
 
data/sample/hello/hello CHANGED
@@ -4,3 +4,5 @@ FILE_PATH=`dirname "$0"`
4
4
  OGRE_LIB=`ruby -e "require 'ogre_config'; print OgreConfig.get_deps_lib_path"`
5
5
 
6
6
  LD_LIBRARY_PATH=$OGRE_LIB:$LD_LIBRARY_PATH ruby $FILE_PATH/hello.rb
7
+
8
+ #LD_LIBRARY_PATH=$OGRE_LIB:$LD_LIBRARY_PATH gdb ruby
@@ -1,11 +1,11 @@
1
1
 
2
2
  $LOAD_PATH.push(File.dirname(File.expand_path(__FILE__)) + "/../../lib")
3
3
 
4
+ require "bullet"
4
5
  require "ogre"
5
6
  require "ois"
6
7
  require "ogrebites"
7
8
  require "procedural"
8
- require "bullet"
9
9
  require "ogre_config"
10
10
 
11
11
  require_relative "ui_listener"
@@ -135,6 +135,15 @@ class World < Ogre::FrameListener
135
135
  @tray_mgr.hide_cursor()
136
136
  end
137
137
 
138
+ def finalize()
139
+ # patch for GC.
140
+ @dynamics_world.remove_rigid_body(@floor.rigid_body)
141
+ @boxes.each{|box|
142
+ @dynamics_world.remove_rigid_body(box.rigid_body)
143
+ }
144
+ @boxes = []
145
+ end
146
+
138
147
  def run
139
148
  # set background and some fog
140
149
  @vp.set_background_colour(Ogre::ColourValue.new(1.0, 1.0, 0.8))
@@ -177,6 +186,7 @@ class World < Ogre::FrameListener
177
186
  }
178
187
 
179
188
  @root.start_rendering()
189
+ finalize()
180
190
  end
181
191
 
182
192
  def shot_box()
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: teienlib
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.3
4
+ version: 0.0.4
5
5
  prerelease:
6
6
  platform: x86-linux
7
7
  authors:
@@ -9,11 +9,11 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-10-02 00:00:00.000000000 Z
12
+ date: 2012-10-19 00:00:00.000000000 Z
13
13
  dependencies:
14
14
  - !ruby/object:Gem::Dependency
15
15
  name: ruby-ogre
16
- requirement: &81857840 !ruby/object:Gem::Requirement
16
+ requirement: &82615430 !ruby/object:Gem::Requirement
17
17
  none: false
18
18
  requirements:
19
19
  - - ! '>='
@@ -21,10 +21,10 @@ dependencies:
21
21
  version: '0'
22
22
  type: :runtime
23
23
  prerelease: false
24
- version_requirements: *81857840
24
+ version_requirements: *82615430
25
25
  - !ruby/object:Gem::Dependency
26
26
  name: ruby-bullet
27
- requirement: &81857210 !ruby/object:Gem::Requirement
27
+ requirement: &82615120 !ruby/object:Gem::Requirement
28
28
  none: false
29
29
  requirements:
30
30
  - - ! '>='
@@ -32,7 +32,7 @@ dependencies:
32
32
  version: '0'
33
33
  type: :runtime
34
34
  prerelease: false
35
- version_requirements: *81857210
35
+ version_requirements: *82615120
36
36
  description: An extension library for Teien.
37
37
  email:
38
38
  - abexsoft@gmail.com