bullet3 0.1.0

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.
Files changed (54) hide show
  1. checksums.yaml +7 -0
  2. data/LICENSE.txt +21 -0
  3. data/README.md +194 -0
  4. data/data/cube.urdf +22 -0
  5. data/data/plane.urdf +19 -0
  6. data/ext/bullet3/CMakeLists.txt +224 -0
  7. data/ext/bullet3/bullet3.cpp +34 -0
  8. data/ext/bullet3/collision/rb_collision.cpp +428 -0
  9. data/ext/bullet3/collision/rb_collision.hpp +87 -0
  10. data/ext/bullet3/collision/shapes/rb_collision_shape.cpp +485 -0
  11. data/ext/bullet3/collision/shapes/rb_collision_shape.hpp +5 -0
  12. data/ext/bullet3/constraints/rb_constraints.cpp +1310 -0
  13. data/ext/bullet3/constraints/rb_constraints.hpp +226 -0
  14. data/ext/bullet3/dynamics/rb_dynamics.cpp +862 -0
  15. data/ext/bullet3/dynamics/rb_dynamics.hpp +180 -0
  16. data/ext/bullet3/extconf.rb +57 -0
  17. data/ext/bullet3/io/rb_io.cpp +108 -0
  18. data/ext/bullet3/io/rb_io.hpp +40 -0
  19. data/ext/bullet3/linear_math/rb_matrix3x3.cpp +93 -0
  20. data/ext/bullet3/linear_math/rb_matrix3x3.hpp +5 -0
  21. data/ext/bullet3/linear_math/rb_quaternion.cpp +134 -0
  22. data/ext/bullet3/linear_math/rb_quaternion.hpp +5 -0
  23. data/ext/bullet3/linear_math/rb_transform.cpp +157 -0
  24. data/ext/bullet3/linear_math/rb_transform.hpp +34 -0
  25. data/ext/bullet3/linear_math/rb_vector3.cpp +123 -0
  26. data/ext/bullet3/linear_math/rb_vector3.hpp +5 -0
  27. data/ext/bullet3/multi_body/rb_multi_body.cpp +1000 -0
  28. data/ext/bullet3/multi_body/rb_multi_body.hpp +190 -0
  29. data/ext/bullet3/soft_body/rb_soft_body.cpp +720 -0
  30. data/ext/bullet3/soft_body/rb_soft_body.hpp +122 -0
  31. data/ext/bullet3/util/rb_debug_draw.cpp +250 -0
  32. data/ext/bullet3/util/rb_debug_draw.hpp +47 -0
  33. data/ext/bullet3/util/ruby_cpp_compat.hpp +29 -0
  34. data/ext/bullet3/util/type_conversions.hpp +107 -0
  35. data/ext/bullet3/vehicle/rb_vehicle.cpp +467 -0
  36. data/ext/bullet3/vehicle/rb_vehicle.hpp +115 -0
  37. data/lib/bullet3/collision.rb +6 -0
  38. data/lib/bullet3/constraints.rb +6 -0
  39. data/lib/bullet3/data.rb +39 -0
  40. data/lib/bullet3/debug_draw.rb +73 -0
  41. data/lib/bullet3/dynamics.rb +4 -0
  42. data/lib/bullet3/io.rb +110 -0
  43. data/lib/bullet3/linear_math/matrix3x3.rb +69 -0
  44. data/lib/bullet3/linear_math/quaternion.rb +187 -0
  45. data/lib/bullet3/linear_math/transform.rb +48 -0
  46. data/lib/bullet3/linear_math/vector3.rb +199 -0
  47. data/lib/bullet3/linear_math.rb +6 -0
  48. data/lib/bullet3/multi_body.rb +6 -0
  49. data/lib/bullet3/simulation.rb +1170 -0
  50. data/lib/bullet3/soft_body.rb +6 -0
  51. data/lib/bullet3/vehicle.rb +4 -0
  52. data/lib/bullet3/version.rb +5 -0
  53. data/lib/bullet3.rb +49 -0
  54. metadata +124 -0
@@ -0,0 +1,6 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bullet3
4
+ module SoftBody
5
+ end unless const_defined?(:SoftBody, false)
6
+ end
@@ -0,0 +1,4 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bullet3
4
+ end
@@ -0,0 +1,5 @@
1
+ # frozen_string_literal: true
2
+
3
+ module Bullet3
4
+ VERSION = "0.1.0"
5
+ end
data/lib/bullet3.rb ADDED
@@ -0,0 +1,49 @@
1
+ # frozen_string_literal: true
2
+
3
+ require_relative "bullet3/version"
4
+
5
+ module Bullet3
6
+ class Error < StandardError; end
7
+
8
+ class << self
9
+ attr_reader :native_load_error
10
+
11
+ def native?
12
+ const_defined?(:DiscreteDynamicsWorld, false)
13
+ end
14
+
15
+ def load_native_extension(required: false)
16
+ return true if native?
17
+ return false if ENV["BULLET3_SKIP_NATIVE"] == "1" && !required
18
+
19
+ require "bullet3/bullet3"
20
+ true
21
+ rescue LoadError => error
22
+ @native_load_error = error
23
+ raise if required || ENV["BULLET3_REQUIRE_NATIVE"] == "1"
24
+
25
+ false
26
+ end
27
+
28
+ def require_native_extension!(feature)
29
+ return true if load_native_extension
30
+
31
+ detail = native_load_error ? " #{native_load_error.message}" : ""
32
+ raise Error, "native extension is required for #{feature}. Run `bundle exec rake compile` before using it.#{detail}"
33
+ end
34
+ end
35
+ end
36
+
37
+ Bullet3.load_native_extension(required: ENV["BULLET3_REQUIRE_NATIVE"] == "1")
38
+
39
+ require_relative "bullet3/linear_math"
40
+ require_relative "bullet3/collision"
41
+ require_relative "bullet3/dynamics"
42
+ require_relative "bullet3/constraints"
43
+ require_relative "bullet3/data"
44
+ require_relative "bullet3/debug_draw"
45
+ require_relative "bullet3/vehicle"
46
+ require_relative "bullet3/soft_body"
47
+ require_relative "bullet3/multi_body"
48
+ require_relative "bullet3/simulation"
49
+ require_relative "bullet3/io"
metadata ADDED
@@ -0,0 +1,124 @@
1
+ --- !ruby/object:Gem::Specification
2
+ name: bullet3
3
+ version: !ruby/object:Gem::Version
4
+ version: 0.1.0
5
+ platform: ruby
6
+ authors:
7
+ - Yudai Takada
8
+ bindir: exe
9
+ cert_chain: []
10
+ date: 1980-01-02 00:00:00.000000000 Z
11
+ dependencies:
12
+ - !ruby/object:Gem::Dependency
13
+ name: rice
14
+ requirement: !ruby/object:Gem::Requirement
15
+ requirements:
16
+ - - "~>"
17
+ - !ruby/object:Gem::Version
18
+ version: '4.0'
19
+ type: :runtime
20
+ prerelease: false
21
+ version_requirements: !ruby/object:Gem::Requirement
22
+ requirements:
23
+ - - "~>"
24
+ - !ruby/object:Gem::Version
25
+ version: '4.0'
26
+ - !ruby/object:Gem::Dependency
27
+ name: rexml
28
+ requirement: !ruby/object:Gem::Requirement
29
+ requirements:
30
+ - - "~>"
31
+ - !ruby/object:Gem::Version
32
+ version: '3.4'
33
+ type: :runtime
34
+ prerelease: false
35
+ version_requirements: !ruby/object:Gem::Requirement
36
+ requirements:
37
+ - - "~>"
38
+ - !ruby/object:Gem::Version
39
+ version: '3.4'
40
+ description: Ruby bindings for bullet3 with a low-level API and a Ruby-friendly simulation
41
+ layer.
42
+ email:
43
+ - t.yudai92@gmail.com
44
+ executables: []
45
+ extensions:
46
+ - ext/bullet3/extconf.rb
47
+ extra_rdoc_files: []
48
+ files:
49
+ - LICENSE.txt
50
+ - README.md
51
+ - data/cube.urdf
52
+ - data/plane.urdf
53
+ - ext/bullet3/CMakeLists.txt
54
+ - ext/bullet3/bullet3.cpp
55
+ - ext/bullet3/collision/rb_collision.cpp
56
+ - ext/bullet3/collision/rb_collision.hpp
57
+ - ext/bullet3/collision/shapes/rb_collision_shape.cpp
58
+ - ext/bullet3/collision/shapes/rb_collision_shape.hpp
59
+ - ext/bullet3/constraints/rb_constraints.cpp
60
+ - ext/bullet3/constraints/rb_constraints.hpp
61
+ - ext/bullet3/dynamics/rb_dynamics.cpp
62
+ - ext/bullet3/dynamics/rb_dynamics.hpp
63
+ - ext/bullet3/extconf.rb
64
+ - ext/bullet3/io/rb_io.cpp
65
+ - ext/bullet3/io/rb_io.hpp
66
+ - ext/bullet3/linear_math/rb_matrix3x3.cpp
67
+ - ext/bullet3/linear_math/rb_matrix3x3.hpp
68
+ - ext/bullet3/linear_math/rb_quaternion.cpp
69
+ - ext/bullet3/linear_math/rb_quaternion.hpp
70
+ - ext/bullet3/linear_math/rb_transform.cpp
71
+ - ext/bullet3/linear_math/rb_transform.hpp
72
+ - ext/bullet3/linear_math/rb_vector3.cpp
73
+ - ext/bullet3/linear_math/rb_vector3.hpp
74
+ - ext/bullet3/multi_body/rb_multi_body.cpp
75
+ - ext/bullet3/multi_body/rb_multi_body.hpp
76
+ - ext/bullet3/soft_body/rb_soft_body.cpp
77
+ - ext/bullet3/soft_body/rb_soft_body.hpp
78
+ - ext/bullet3/util/rb_debug_draw.cpp
79
+ - ext/bullet3/util/rb_debug_draw.hpp
80
+ - ext/bullet3/util/ruby_cpp_compat.hpp
81
+ - ext/bullet3/util/type_conversions.hpp
82
+ - ext/bullet3/vehicle/rb_vehicle.cpp
83
+ - ext/bullet3/vehicle/rb_vehicle.hpp
84
+ - lib/bullet3.rb
85
+ - lib/bullet3/collision.rb
86
+ - lib/bullet3/constraints.rb
87
+ - lib/bullet3/data.rb
88
+ - lib/bullet3/debug_draw.rb
89
+ - lib/bullet3/dynamics.rb
90
+ - lib/bullet3/io.rb
91
+ - lib/bullet3/linear_math.rb
92
+ - lib/bullet3/linear_math/matrix3x3.rb
93
+ - lib/bullet3/linear_math/quaternion.rb
94
+ - lib/bullet3/linear_math/transform.rb
95
+ - lib/bullet3/linear_math/vector3.rb
96
+ - lib/bullet3/multi_body.rb
97
+ - lib/bullet3/simulation.rb
98
+ - lib/bullet3/soft_body.rb
99
+ - lib/bullet3/vehicle.rb
100
+ - lib/bullet3/version.rb
101
+ homepage: https://github.com/ydah/bullet3
102
+ licenses:
103
+ - MIT
104
+ metadata:
105
+ homepage_uri: https://github.com/ydah/bullet3
106
+ source_code_uri: https://github.com/ydah/bullet3
107
+ rdoc_options: []
108
+ require_paths:
109
+ - lib
110
+ required_ruby_version: !ruby/object:Gem::Requirement
111
+ requirements:
112
+ - - ">="
113
+ - !ruby/object:Gem::Version
114
+ version: 3.1.0
115
+ required_rubygems_version: !ruby/object:Gem::Requirement
116
+ requirements:
117
+ - - ">="
118
+ - !ruby/object:Gem::Version
119
+ version: '0'
120
+ requirements: []
121
+ rubygems_version: 4.0.6
122
+ specification_version: 4
123
+ summary: Ruby bindings for the Bullet Physics SDK.
124
+ test_files: []