ruby-bullet 0.0.2-x86-linux → 0.0.3-x86-linux

Sign up to get free protection for your applications and to get access to all the features.
@@ -16,31 +16,31 @@ namespace Swig {
16
16
  }
17
17
 
18
18
 
19
- class SwigDirector_btMotionState : public btMotionState, public Swig::Director {
19
+ class SwigDirector_BtMotionState : public btMotionState, public Swig::Director {
20
20
 
21
21
  public:
22
- SwigDirector_btMotionState(VALUE self);
23
- virtual ~SwigDirector_btMotionState();
22
+ SwigDirector_BtMotionState(VALUE self);
23
+ virtual ~SwigDirector_BtMotionState();
24
24
  virtual void getWorldTransform(btTransform &worldTrans) const;
25
25
  virtual void setWorldTransform(btTransform const &worldTrans);
26
26
  };
27
27
 
28
28
 
29
- struct SwigDirector_btDefaultMotionState : public btDefaultMotionState, public Swig::Director {
29
+ struct SwigDirector_BtDefaultMotionState : public btDefaultMotionState, public Swig::Director {
30
30
 
31
31
  public:
32
- SwigDirector_btDefaultMotionState(VALUE self, btTransform const &startTrans = btTransform::getIdentity(), btTransform const &centerOfMassOffset = btTransform::getIdentity());
33
- virtual ~SwigDirector_btDefaultMotionState();
32
+ SwigDirector_BtDefaultMotionState(VALUE self, btTransform const &startTrans = btTransform::getIdentity(), btTransform const &centerOfMassOffset = btTransform::getIdentity());
33
+ virtual ~SwigDirector_BtDefaultMotionState();
34
34
  virtual void getWorldTransform(btTransform &centerOfMassWorldTrans) const;
35
35
  virtual void setWorldTransform(btTransform const &centerOfMassWorldTrans);
36
36
  };
37
37
 
38
38
 
39
- class SwigDirector_btIDebugDraw : public btIDebugDraw, public Swig::Director {
39
+ class SwigDirector_BtIDebugDraw : public btIDebugDraw, public Swig::Director {
40
40
 
41
41
  public:
42
- SwigDirector_btIDebugDraw(VALUE self);
43
- virtual ~SwigDirector_btIDebugDraw();
42
+ SwigDirector_BtIDebugDraw(VALUE self);
43
+ virtual ~SwigDirector_BtIDebugDraw();
44
44
  virtual void drawLine(btVector3 const &from, btVector3 const &to, btVector3 const &color);
45
45
  virtual void drawLine(btVector3 const &from, btVector3 const &to, btVector3 const &fromColor, btVector3 const &toColor);
46
46
  virtual void drawSphere(btScalar radius, btTransform const &transform, btVector3 const &color);
Binary file
@@ -0,0 +1,28 @@
1
+ class BulletConfig
2
+ def self.get_top_dir
3
+ File.dirname(File.dirname(File.expand_path(__FILE__)))
4
+ end
5
+
6
+ def self.get_deps_lib_path
7
+ "#{get_top_dir()}/deps/lib"
8
+ end
9
+
10
+ def self.get_deps_inc_path
11
+ "#{get_top_dir()}/deps/include/bullet/"
12
+ end
13
+
14
+ def self.get_inc_flags
15
+ " -I#{get_top_dir()}/deps/include/bullet/ " +
16
+ " -I#{get_top_dir()}/deps/include/bullet/LinearMath/ " +
17
+ " -I#{get_top_dir()}/deps/include/bullet/BulletCollision/CollisionDispatch/ " +
18
+ " -I#{get_top_dir()}/deps/include/bullet/BulletCollision/BroadphaseCollision/ " +
19
+ " -I#{get_top_dir()}/deps/include/bullet/BulletCollision/NarrowPhaseCollision/ " +
20
+ " -I#{get_top_dir()}/deps/include/bullet/BulletCollision/CollisionShapes/ " +
21
+ " -I#{get_top_dir()}/deps/include/bullet/BulletCollision/Gimpact/ " +
22
+ " -I#{get_top_dir()}/deps/include/bullet/BulletDynamics/ConstraintSolver/ " +
23
+ " -I#{get_top_dir()}/deps/include/bullet/BulletDynamics/Dynamics/ " +
24
+ " -I#{get_top_dir()}/deps/include/bullet/BulletDynamics/Vehicle/ " +
25
+ " -I#{get_top_dir()}/deps/include/bullet/BulletDynamics/Character/ " +
26
+ " -I#{get_top_dir()}/deps/include/bullet/BulletSoftBody/ "
27
+ end
28
+ end
@@ -1,5 +1,5 @@
1
1
  module Ruby
2
2
  module Bullet
3
- VERSION = "0.0.2"
3
+ VERSION = "0.0.3"
4
4
  end
5
5
  end
@@ -1,7 +1,8 @@
1
- # -*- coding: utf-8 -*-
1
+ $LOAD_PATH.push(File.dirname(File.expand_path(__FILE__)) + "/../../lib")
2
+
2
3
  require 'gtk2'
3
4
  require 'cairo'
4
- require "Bullet.so"
5
+ require "bullet.so"
5
6
 
6
7
  class Physics
7
8
  attr_accessor :context
@@ -21,16 +22,16 @@ class Physics
21
22
  @dynamicsWorld = Bullet::BtDiscreteDynamicsWorld.new(@collisionDispatcher, @gardenAabbCache,
22
23
  @solver, @collisionConfig)
23
24
  gravity = Bullet::BtVector3.new(0.0, 9.8, 0.0)
24
- @dynamicsWorld.setGravity(gravity)
25
+ @dynamicsWorld.set_gravity(gravity)
25
26
 
26
27
  @objects = []
27
28
 
28
29
  @lastTime = -1
29
30
  end
30
31
 
31
- def addObject(obj)
32
+ def add_object(obj)
32
33
  @objects.push(obj)
33
- @dynamicsWorld.addRigidBody(obj.rigidBody)
34
+ @dynamicsWorld.add_rigid_body(obj.rigidBody)
34
35
  end
35
36
 
36
37
  def update(context)
@@ -42,7 +43,7 @@ class Physics
42
43
  @lastTime = nowTime
43
44
 
44
45
  # step
45
- @dynamicsWorld.stepSimulation(delta)
46
+ @dynamicsWorld.step_simulation(delta)
46
47
 
47
48
  @objects.each {|obj|
48
49
  obj.draw(context)
@@ -65,38 +66,38 @@ class Box < Bullet::BtMotionState
65
66
 
66
67
  # position/rotation
67
68
  @transform = Bullet::BtTransform.new()
68
- @transform.setIdentity()
69
+ @transform.set_identity()
69
70
 
70
71
  # create a physics object.
71
72
  @colObj = Bullet::BtBoxShape.new(Bullet::BtVector3.new(width / 2, height / 2, width / 2))
72
73
  inertia = Bullet::BtVector3.new()
73
- @colObj.calculateLocalInertia(mass, inertia)
74
+ @colObj.calculate_local_inertia(mass, inertia)
74
75
 
75
76
  @rigidBody = Bullet::BtRigidBody.new(mass, self, @colObj, inertia)
76
- @rigidBody.setAngularFactor(Bullet::BtVector3.new(0, 0, 1)) # rotate around z-axis only becase of 2D.
77
+ @rigidBody.set_angular_factor(Bullet::BtVector3.new(0, 0, 1)) # rotate around z-axis only becase of 2D.
77
78
  end
78
79
 
79
- def setWorldTransform(worldTrans)
80
+ def set_world_transform(worldTrans)
80
81
  @transform = Bullet::BtTransform.new(worldTrans)
81
82
  end
82
83
 
83
- def getWorldTransform(worldTrans)
84
+ def get_world_transform(worldTrans)
84
85
  end
85
86
 
86
- def setPosition(x, y)
87
- @transform.setOrigin(Bullet::BtVector3.new(x, y, 0.0))
88
- @rigidBody.setCenterOfMassTransform(@transform)
87
+ def set_position(x, y)
88
+ @transform.set_origin(Bullet::BtVector3.new(x, y, 0.0))
89
+ @rigidBody.set_center_of_mass_transform(@transform)
89
90
  end
90
91
 
91
92
  def draw(context)
92
- newPos = @transform.getOrigin()
93
- newRot = @transform.getRotation()
93
+ newPos = @transform.get_origin()
94
+ newRot = @transform.get_rotation()
94
95
 
95
96
  lt = Bullet::BtVector3.new(-@width / 2, -@height / 2, 0)
96
97
  lb = Bullet::BtVector3.new(-@width / 2, @height / 2 , 0)
97
98
 
98
- lt = Bullet::quatRotate(newRot, lt)
99
- lb = Bullet::quatRotate(newRot, lb)
99
+ lt = Bullet::quat_rotate(newRot, lt)
100
+ lb = Bullet::quat_rotate(newRot, lb)
100
101
  rb = -lt
101
102
  rt = -lb
102
103
 
@@ -121,15 +122,15 @@ id = 0
121
122
  11.times {|x|
122
123
  5.times {|y|
123
124
  box = Box.new(physics, 1.0, 10, 10, 'sky blue')
124
- box.setPosition(100 + 10 * x, 50 - 10 * y)
125
- physics.addObject(box)
125
+ box.set_position(100 + 10 * x, 50 - 10 * y)
126
+ physics.add_object(box)
126
127
  }
127
128
  }
128
129
 
129
130
  # floor
130
131
  floor = Box.new(physics, 0, 100, 5, 'gray')
131
- floor.setPosition(150, 200)
132
- physics.addObject(floor)
132
+ floor.set_position(150, 200)
133
+ physics.add_object(floor)
133
134
 
134
135
 
135
136
  ## create a drawing window.
@@ -150,8 +151,8 @@ drawing_area.signal_connect("expose-event") do |widget, event|
150
151
  # create a new box per 3sec.
151
152
  if (delta > 3.0)
152
153
  box = Box.new(physics, 1.0, 10, 10, 'orange')
153
- box.setPosition(125 + (physics.objects.length % 10) * 5, 0)
154
- physics.addObject(box)
154
+ box.set_position(125 + (physics.objects.length % 10) * 5, 0)
155
+ physics.add_object(box)
155
156
  delta = 0
156
157
  end
157
158
  true
metadata CHANGED
@@ -1,7 +1,7 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: ruby-bullet
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.2
4
+ version: 0.0.3
5
5
  prerelease:
6
6
  platform: x86-linux
7
7
  authors:
@@ -9,7 +9,7 @@ authors:
9
9
  autorequire:
10
10
  bindir: bin
11
11
  cert_chain: []
12
- date: 2012-09-18 00:00:00.000000000 Z
12
+ date: 2012-10-02 00:00:00.000000000 Z
13
13
  dependencies: []
14
14
  description: This is a binary package of the ruby wrapper of Bullet.
15
15
  email:
@@ -197,13 +197,13 @@ files:
197
197
  - bindings/bullet/interface/BulletCollision/CollisionShapes/btCollisionShape.i
198
198
  - bindings/bullet/interface/BulletCollision/CollisionShapes/btMaterial.i
199
199
  - bindings/bullet/interface/BulletCollision/CollisionShapes/btConvexInternalShape.i
200
- - bindings/bullet/interface/Makefile
200
+ - bindings/bullet/interface/Rakefile
201
201
  - bindings/bullet/interface/bullet_all.i
202
202
  - bindings/bullet/src/TickListener.h
203
- - lib/Version.rb
204
- - lib/Bullet.so
205
- - lib/BulletConfig.rb
206
- - sample/hello_bullet/HelloBullet.rb
203
+ - lib/bullet_config.rb
204
+ - lib/version.rb
205
+ - lib/bullet.so
206
+ - sample/hello_bullet/hello_bullet.rb
207
207
  - deps/lib/libBulletMultiThreaded.a
208
208
  - deps/lib/libBulletSoftBody.a
209
209
  - deps/lib/libBulletCollision.a
@@ -1,19 +0,0 @@
1
- .PHONY: clean
2
-
3
- SWIG = swig
4
- DEPS_DIR = ../../../deps/
5
-
6
- include ../../../deps/env.mk
7
-
8
- SWIGFLAGS = -ruby -c++ -w801 $(BULLET_INC) -I../src
9
- RUBY = ruby
10
-
11
- TARGET = bullet_wrap.cpp
12
-
13
- all: $(TARGET)
14
-
15
- $(TARGET): bullet.i
16
- $(SWIG) $(SWIGFLAGS) -o $@ $<
17
-
18
- clean:
19
- @rm -f $(TARGET)
data/lib/BulletConfig.rb DELETED
@@ -1,28 +0,0 @@
1
- class BulletConfig
2
- def self.getTopDir
3
- File.dirname(File.dirname(File.expand_path(__FILE__)))
4
- end
5
-
6
- def self.getDepsLibPath
7
- "#{getTopDir()}/deps/lib"
8
- end
9
-
10
- def self.getDepsIncPath
11
- "#{getTopDir()}/deps/include/bullet/"
12
- end
13
-
14
- def self.getIncFlags
15
- " -I#{getTopDir()}/deps/include/bullet/ " +
16
- " -I#{getTopDir()}/deps/include/bullet/LinearMath/ " +
17
- " -I#{getTopDir()}/deps/include/bullet/BulletCollision/CollisionDispatch/ " +
18
- " -I#{getTopDir()}/deps/include/bullet/BulletCollision/BroadphaseCollision/ " +
19
- " -I#{getTopDir()}/deps/include/bullet/BulletCollision/NarrowPhaseCollision/ " +
20
- " -I#{getTopDir()}/deps/include/bullet/BulletCollision/CollisionShapes/ " +
21
- " -I#{getTopDir()}/deps/include/bullet/BulletCollision/Gimpact/ " +
22
- " -I#{getTopDir()}/deps/include/bullet/BulletDynamics/ConstraintSolver/ " +
23
- " -I#{getTopDir()}/deps/include/bullet/BulletDynamics/Dynamics/ " +
24
- " -I#{getTopDir()}/deps/include/bullet/BulletDynamics/Vehicle/ " +
25
- " -I#{getTopDir()}/deps/include/bullet/BulletDynamics/Character/ " +
26
- " -I#{getTopDir()}/deps/include/bullet/BulletSoftBody/ "
27
- end
28
- end