box2d-bindings 0.1.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +7 -0
- data/ChangeLog +35 -0
- data/LICENSE.txt +21 -0
- data/README.md +50 -0
- data/lib/box2d.rb +50 -0
- data/lib/box2d_base.rb +95 -0
- data/lib/box2d_collision.rb +832 -0
- data/lib/box2d_collision_inline.rb +47 -0
- data/lib/box2d_helper.rb +67 -0
- data/lib/box2d_id.rb +146 -0
- data/lib/box2d_id_inline.rb +53 -0
- data/lib/box2d_main.rb +337 -0
- data/lib/box2d_math_functions.rb +156 -0
- data/lib/box2d_math_inline_functions.rb +104 -0
- data/lib/box2d_types.rb +1583 -0
- data/lib/libbox2d.aarch64.so +0 -0
- data/lib/libbox2d.arm64.dylib +0 -0
- data/lib/libbox2d.dll +0 -0
- data/lib/libbox2d.x86_64.dylib +0 -0
- data/lib/libbox2d.x86_64.so +0 -0
- metadata +75 -0
@@ -0,0 +1,47 @@
|
|
1
|
+
# Ruby-Box2D : Yet another Box2D wrapper for Ruby
|
2
|
+
#
|
3
|
+
# * https://github.com/vaiorabbit/box2d-bindings
|
4
|
+
#
|
5
|
+
# [NOTICE] Autogenerated. Do not edit.
|
6
|
+
|
7
|
+
require 'ffi'
|
8
|
+
|
9
|
+
module Box2D
|
10
|
+
extend FFI::Library
|
11
|
+
# Define/Macro
|
12
|
+
|
13
|
+
|
14
|
+
# Enum
|
15
|
+
|
16
|
+
|
17
|
+
# Typedef
|
18
|
+
|
19
|
+
|
20
|
+
# Struct
|
21
|
+
|
22
|
+
|
23
|
+
# Function
|
24
|
+
|
25
|
+
def self.setup_collision_inline_symbols(method_naming: :original)
|
26
|
+
entries = [
|
27
|
+
[:DynamicTree_GetUserData, :b2DynamicTree_GetUserData, [:pointer, :int], :int],
|
28
|
+
[:DynamicTree_GetAABB, :b2DynamicTree_GetAABB, [:pointer, :int], AABB.by_value],
|
29
|
+
]
|
30
|
+
entries.each do |entry|
|
31
|
+
api_name = if method_naming == :snake_case
|
32
|
+
snake_case_name = entry[0].to_s.gsub(/([A-Z]+)([A-Z0-9][a-z])/, '\1_\2').gsub(/([a-z\d])([A-Z0-9])/, '\1_\2').downcase
|
33
|
+
snake_case_name.gsub!('vector_3', 'vector3_') if snake_case_name.include?('vector_3')
|
34
|
+
snake_case_name.gsub!('vector_2', 'vector2_') if snake_case_name.include?('vector_2')
|
35
|
+
snake_case_name.chop! if snake_case_name.end_with?('_')
|
36
|
+
snake_case_name.to_sym
|
37
|
+
else
|
38
|
+
entry[0]
|
39
|
+
end
|
40
|
+
attach_function api_name, entry[1], entry[2], entry[3]
|
41
|
+
rescue FFI::NotFoundError => e
|
42
|
+
warn "[Warning] Failed to import #{entry[0]} (#{e})."
|
43
|
+
end
|
44
|
+
end
|
45
|
+
|
46
|
+
end
|
47
|
+
|
data/lib/box2d_helper.rb
ADDED
@@ -0,0 +1,67 @@
|
|
1
|
+
# Box2D wrapper for Ruby
|
2
|
+
#
|
3
|
+
# * https://github.com/vaiorabbit/box2d-bindings
|
4
|
+
|
5
|
+
require_relative 'box2d_id'
|
6
|
+
|
7
|
+
module Box2D
|
8
|
+
#
|
9
|
+
# ID helper
|
10
|
+
#
|
11
|
+
|
12
|
+
NULL_WORLDID = WorldId.new.freeze
|
13
|
+
NULL_BODYID = BodyId.new.freeze
|
14
|
+
NULL_SHAPEID = ShapeId.new.freeze
|
15
|
+
NULL_CHAINID = ChainId.new.freeze
|
16
|
+
NULL_JOINTID = JointId.new.freeze
|
17
|
+
|
18
|
+
def self.id_null(id)
|
19
|
+
id.index1 == 0
|
20
|
+
end
|
21
|
+
|
22
|
+
def self.id_non_null(id)
|
23
|
+
id.index1 != 0
|
24
|
+
end
|
25
|
+
|
26
|
+
def self.id_equals(id1, id2)
|
27
|
+
id1.index1 == id2.index1 && id1.world0 == id2.world0 && id1.revision == id2.revision
|
28
|
+
end
|
29
|
+
|
30
|
+
#
|
31
|
+
# Math helper
|
32
|
+
#
|
33
|
+
|
34
|
+
VEC2_ZERO = Vec2.new.freeze
|
35
|
+
ROT_IDENTITY = Rot.create_as(1.0, 0.0).freeze
|
36
|
+
TRANSFORM_IDENTITY = Transform.create_as(Vec2.new.freeze, Rot.create_as(1.0, 0.0).freeze).freeze
|
37
|
+
MAT22_ZERO = Mat22.create_as(Vec2.new.freeze, Vec2.new.freeze).freeze
|
38
|
+
|
39
|
+
class Vec2
|
40
|
+
def self.copy_from(vec)
|
41
|
+
Vec2.create_as(vec[:x], vec[:y])
|
42
|
+
end
|
43
|
+
|
44
|
+
def set(x, y)
|
45
|
+
self[:x] = x
|
46
|
+
self[:y] = y
|
47
|
+
self
|
48
|
+
end
|
49
|
+
|
50
|
+
def add(x, y)
|
51
|
+
self[:x] = self[:x] + x
|
52
|
+
self[:y] = self[:y] + y
|
53
|
+
self
|
54
|
+
end
|
55
|
+
|
56
|
+
def add_vector(v)
|
57
|
+
self[:x] = self[:x] + v[:x]
|
58
|
+
self[:y] = self[:y] + v[:y]
|
59
|
+
self
|
60
|
+
end
|
61
|
+
|
62
|
+
def to_a
|
63
|
+
[x, y]
|
64
|
+
end
|
65
|
+
end
|
66
|
+
|
67
|
+
end
|
data/lib/box2d_id.rb
ADDED
@@ -0,0 +1,146 @@
|
|
1
|
+
# Ruby-Box2D : Yet another Box2D wrapper for Ruby
|
2
|
+
#
|
3
|
+
# * https://github.com/vaiorabbit/box2d-bindings
|
4
|
+
#
|
5
|
+
# [NOTICE] Autogenerated. Do not edit.
|
6
|
+
|
7
|
+
require 'ffi'
|
8
|
+
|
9
|
+
module Box2D
|
10
|
+
extend FFI::Library
|
11
|
+
# Define/Macro
|
12
|
+
|
13
|
+
|
14
|
+
# Enum
|
15
|
+
|
16
|
+
|
17
|
+
# Typedef
|
18
|
+
|
19
|
+
|
20
|
+
# Struct
|
21
|
+
|
22
|
+
class WorldId < FFI::Struct
|
23
|
+
layout(
|
24
|
+
:index1, :ushort,
|
25
|
+
:revision, :ushort,
|
26
|
+
)
|
27
|
+
def index1 = self[:index1]
|
28
|
+
def index1=(v) self[:index1] = v end
|
29
|
+
def revision = self[:revision]
|
30
|
+
def revision=(v) self[:revision] = v end
|
31
|
+
def self.create_as(_index1_, _revision_)
|
32
|
+
instance = WorldId.new
|
33
|
+
instance[:index1] = _index1_
|
34
|
+
instance[:revision] = _revision_
|
35
|
+
instance
|
36
|
+
end
|
37
|
+
end
|
38
|
+
|
39
|
+
class BodyId < FFI::Struct
|
40
|
+
layout(
|
41
|
+
:index1, :int,
|
42
|
+
:world0, :ushort,
|
43
|
+
:revision, :ushort,
|
44
|
+
)
|
45
|
+
def index1 = self[:index1]
|
46
|
+
def index1=(v) self[:index1] = v end
|
47
|
+
def world0 = self[:world0]
|
48
|
+
def world0=(v) self[:world0] = v end
|
49
|
+
def revision = self[:revision]
|
50
|
+
def revision=(v) self[:revision] = v end
|
51
|
+
def self.create_as(_index1_, _world0_, _revision_)
|
52
|
+
instance = BodyId.new
|
53
|
+
instance[:index1] = _index1_
|
54
|
+
instance[:world0] = _world0_
|
55
|
+
instance[:revision] = _revision_
|
56
|
+
instance
|
57
|
+
end
|
58
|
+
end
|
59
|
+
|
60
|
+
class ShapeId < FFI::Struct
|
61
|
+
layout(
|
62
|
+
:index1, :int,
|
63
|
+
:world0, :ushort,
|
64
|
+
:revision, :ushort,
|
65
|
+
)
|
66
|
+
def index1 = self[:index1]
|
67
|
+
def index1=(v) self[:index1] = v end
|
68
|
+
def world0 = self[:world0]
|
69
|
+
def world0=(v) self[:world0] = v end
|
70
|
+
def revision = self[:revision]
|
71
|
+
def revision=(v) self[:revision] = v end
|
72
|
+
def self.create_as(_index1_, _world0_, _revision_)
|
73
|
+
instance = ShapeId.new
|
74
|
+
instance[:index1] = _index1_
|
75
|
+
instance[:world0] = _world0_
|
76
|
+
instance[:revision] = _revision_
|
77
|
+
instance
|
78
|
+
end
|
79
|
+
end
|
80
|
+
|
81
|
+
class ChainId < FFI::Struct
|
82
|
+
layout(
|
83
|
+
:index1, :int,
|
84
|
+
:world0, :ushort,
|
85
|
+
:revision, :ushort,
|
86
|
+
)
|
87
|
+
def index1 = self[:index1]
|
88
|
+
def index1=(v) self[:index1] = v end
|
89
|
+
def world0 = self[:world0]
|
90
|
+
def world0=(v) self[:world0] = v end
|
91
|
+
def revision = self[:revision]
|
92
|
+
def revision=(v) self[:revision] = v end
|
93
|
+
def self.create_as(_index1_, _world0_, _revision_)
|
94
|
+
instance = ChainId.new
|
95
|
+
instance[:index1] = _index1_
|
96
|
+
instance[:world0] = _world0_
|
97
|
+
instance[:revision] = _revision_
|
98
|
+
instance
|
99
|
+
end
|
100
|
+
end
|
101
|
+
|
102
|
+
class JointId < FFI::Struct
|
103
|
+
layout(
|
104
|
+
:index1, :int,
|
105
|
+
:world0, :ushort,
|
106
|
+
:revision, :ushort,
|
107
|
+
)
|
108
|
+
def index1 = self[:index1]
|
109
|
+
def index1=(v) self[:index1] = v end
|
110
|
+
def world0 = self[:world0]
|
111
|
+
def world0=(v) self[:world0] = v end
|
112
|
+
def revision = self[:revision]
|
113
|
+
def revision=(v) self[:revision] = v end
|
114
|
+
def self.create_as(_index1_, _world0_, _revision_)
|
115
|
+
instance = JointId.new
|
116
|
+
instance[:index1] = _index1_
|
117
|
+
instance[:world0] = _world0_
|
118
|
+
instance[:revision] = _revision_
|
119
|
+
instance
|
120
|
+
end
|
121
|
+
end
|
122
|
+
|
123
|
+
|
124
|
+
# Function
|
125
|
+
|
126
|
+
def self.setup_id_symbols(method_naming: :original)
|
127
|
+
entries = [
|
128
|
+
]
|
129
|
+
entries.each do |entry|
|
130
|
+
api_name = if method_naming == :snake_case
|
131
|
+
snake_case_name = entry[0].to_s.gsub(/([A-Z]+)([A-Z0-9][a-z])/, '\1_\2').gsub(/([a-z\d])([A-Z0-9])/, '\1_\2').downcase
|
132
|
+
snake_case_name.gsub!('vector_3', 'vector3_') if snake_case_name.include?('vector_3')
|
133
|
+
snake_case_name.gsub!('vector_2', 'vector2_') if snake_case_name.include?('vector_2')
|
134
|
+
snake_case_name.chop! if snake_case_name.end_with?('_')
|
135
|
+
snake_case_name.to_sym
|
136
|
+
else
|
137
|
+
entry[0]
|
138
|
+
end
|
139
|
+
attach_function api_name, entry[1], entry[2], entry[3]
|
140
|
+
rescue FFI::NotFoundError => e
|
141
|
+
warn "[Warning] Failed to import #{entry[0]} (#{e})."
|
142
|
+
end
|
143
|
+
end
|
144
|
+
|
145
|
+
end
|
146
|
+
|
@@ -0,0 +1,53 @@
|
|
1
|
+
# Ruby-Box2D : Yet another Box2D wrapper for Ruby
|
2
|
+
#
|
3
|
+
# * https://github.com/vaiorabbit/box2d-bindings
|
4
|
+
#
|
5
|
+
# [NOTICE] Autogenerated. Do not edit.
|
6
|
+
|
7
|
+
require 'ffi'
|
8
|
+
|
9
|
+
module Box2D
|
10
|
+
extend FFI::Library
|
11
|
+
# Define/Macro
|
12
|
+
|
13
|
+
|
14
|
+
# Enum
|
15
|
+
|
16
|
+
|
17
|
+
# Typedef
|
18
|
+
|
19
|
+
|
20
|
+
# Struct
|
21
|
+
|
22
|
+
|
23
|
+
# Function
|
24
|
+
|
25
|
+
def self.setup_id_inline_symbols(method_naming: :original)
|
26
|
+
entries = [
|
27
|
+
[:StoreBodyId, :b2StoreBodyId, [BodyId.by_value], :ulong_long],
|
28
|
+
[:LoadBodyId, :b2LoadBodyId, [:ulong_long], BodyId.by_value],
|
29
|
+
[:StoreShapeId, :b2StoreShapeId, [ShapeId.by_value], :ulong_long],
|
30
|
+
[:LoadShapeId, :b2LoadShapeId, [:ulong_long], ShapeId.by_value],
|
31
|
+
[:StoreChainId, :b2StoreChainId, [ChainId.by_value], :ulong_long],
|
32
|
+
[:LoadChainId, :b2LoadChainId, [:ulong_long], ChainId.by_value],
|
33
|
+
[:StoreJointId, :b2StoreJointId, [JointId.by_value], :ulong_long],
|
34
|
+
[:LoadJointId, :b2LoadJointId, [:ulong_long], JointId.by_value],
|
35
|
+
]
|
36
|
+
entries.each do |entry|
|
37
|
+
api_name = if method_naming == :snake_case
|
38
|
+
snake_case_name = entry[0].to_s.gsub(/([A-Z]+)([A-Z0-9][a-z])/, '\1_\2').gsub(/([a-z\d])([A-Z0-9])/, '\1_\2').downcase
|
39
|
+
snake_case_name.gsub!('vector_3', 'vector3_') if snake_case_name.include?('vector_3')
|
40
|
+
snake_case_name.gsub!('vector_2', 'vector2_') if snake_case_name.include?('vector_2')
|
41
|
+
snake_case_name.chop! if snake_case_name.end_with?('_')
|
42
|
+
snake_case_name.to_sym
|
43
|
+
else
|
44
|
+
entry[0]
|
45
|
+
end
|
46
|
+
attach_function api_name, entry[1], entry[2], entry[3]
|
47
|
+
rescue FFI::NotFoundError => e
|
48
|
+
warn "[Warning] Failed to import #{entry[0]} (#{e})."
|
49
|
+
end
|
50
|
+
end
|
51
|
+
|
52
|
+
end
|
53
|
+
|
data/lib/box2d_main.rb
ADDED
@@ -0,0 +1,337 @@
|
|
1
|
+
# Ruby-Box2D : Yet another Box2D wrapper for Ruby
|
2
|
+
#
|
3
|
+
# * https://github.com/vaiorabbit/box2d-bindings
|
4
|
+
#
|
5
|
+
# [NOTICE] Autogenerated. Do not edit.
|
6
|
+
|
7
|
+
require 'ffi'
|
8
|
+
|
9
|
+
module Box2D
|
10
|
+
extend FFI::Library
|
11
|
+
# Define/Macro
|
12
|
+
|
13
|
+
|
14
|
+
# Enum
|
15
|
+
|
16
|
+
|
17
|
+
# Typedef
|
18
|
+
|
19
|
+
|
20
|
+
# Struct
|
21
|
+
|
22
|
+
|
23
|
+
# Function
|
24
|
+
|
25
|
+
def self.setup_main_symbols(method_naming: :original)
|
26
|
+
entries = [
|
27
|
+
[:CreateWorld, :b2CreateWorld, [:pointer], WorldId.by_value],
|
28
|
+
[:DestroyWorld, :b2DestroyWorld, [WorldId.by_value], :void],
|
29
|
+
[:World_IsValid, :b2World_IsValid, [WorldId.by_value], :bool],
|
30
|
+
[:World_Step, :b2World_Step, [WorldId.by_value, :float, :int], :void],
|
31
|
+
[:World_Draw, :b2World_Draw, [WorldId.by_value, :pointer], :void],
|
32
|
+
[:World_GetBodyEvents, :b2World_GetBodyEvents, [WorldId.by_value], BodyEvents.by_value],
|
33
|
+
[:World_GetSensorEvents, :b2World_GetSensorEvents, [WorldId.by_value], SensorEvents.by_value],
|
34
|
+
[:World_GetContactEvents, :b2World_GetContactEvents, [WorldId.by_value], ContactEvents.by_value],
|
35
|
+
[:World_OverlapAABB, :b2World_OverlapAABB, [WorldId.by_value, AABB.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
36
|
+
[:World_OverlapPoint, :b2World_OverlapPoint, [WorldId.by_value, Vec2.by_value, Transform.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
37
|
+
[:World_OverlapCircle, :b2World_OverlapCircle, [WorldId.by_value, :pointer, Transform.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
38
|
+
[:World_OverlapCapsule, :b2World_OverlapCapsule, [WorldId.by_value, :pointer, Transform.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
39
|
+
[:World_OverlapPolygon, :b2World_OverlapPolygon, [WorldId.by_value, :pointer, Transform.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
40
|
+
[:World_CastRay, :b2World_CastRay, [WorldId.by_value, Vec2.by_value, Vec2.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
41
|
+
[:World_CastRayClosest, :b2World_CastRayClosest, [WorldId.by_value, Vec2.by_value, Vec2.by_value, QueryFilter.by_value], RayResult.by_value],
|
42
|
+
[:World_CastCircle, :b2World_CastCircle, [WorldId.by_value, :pointer, Transform.by_value, Vec2.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
43
|
+
[:World_CastCapsule, :b2World_CastCapsule, [WorldId.by_value, :pointer, Transform.by_value, Vec2.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
44
|
+
[:World_CastPolygon, :b2World_CastPolygon, [WorldId.by_value, :pointer, Transform.by_value, Vec2.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
|
45
|
+
[:World_EnableSleeping, :b2World_EnableSleeping, [WorldId.by_value, :bool], :void],
|
46
|
+
[:World_IsSleepingEnabled, :b2World_IsSleepingEnabled, [WorldId.by_value], :bool],
|
47
|
+
[:World_EnableContinuous, :b2World_EnableContinuous, [WorldId.by_value, :bool], :void],
|
48
|
+
[:World_IsContinuousEnabled, :b2World_IsContinuousEnabled, [WorldId.by_value], :bool],
|
49
|
+
[:World_SetRestitutionThreshold, :b2World_SetRestitutionThreshold, [WorldId.by_value, :float], :void],
|
50
|
+
[:World_GetRestitutionThreshold, :b2World_GetRestitutionThreshold, [WorldId.by_value], :float],
|
51
|
+
[:World_SetHitEventThreshold, :b2World_SetHitEventThreshold, [WorldId.by_value, :float], :void],
|
52
|
+
[:World_GetHitEventThreshold, :b2World_GetHitEventThreshold, [WorldId.by_value], :float],
|
53
|
+
[:World_SetCustomFilterCallback, :b2World_SetCustomFilterCallback, [WorldId.by_value, :pointer, :pointer], :void],
|
54
|
+
[:World_SetPreSolveCallback, :b2World_SetPreSolveCallback, [WorldId.by_value, :pointer, :pointer], :void],
|
55
|
+
[:World_SetGravity, :b2World_SetGravity, [WorldId.by_value, Vec2.by_value], :void],
|
56
|
+
[:World_GetGravity, :b2World_GetGravity, [WorldId.by_value], Vec2.by_value],
|
57
|
+
[:World_Explode, :b2World_Explode, [WorldId.by_value, :pointer], :void],
|
58
|
+
[:World_SetContactTuning, :b2World_SetContactTuning, [WorldId.by_value, :float, :float, :float], :void],
|
59
|
+
[:World_SetJointTuning, :b2World_SetJointTuning, [WorldId.by_value, :float, :float], :void],
|
60
|
+
[:World_SetMaximumLinearSpeed, :b2World_SetMaximumLinearSpeed, [WorldId.by_value, :float], :void],
|
61
|
+
[:World_GetMaximumLinearSpeed, :b2World_GetMaximumLinearSpeed, [WorldId.by_value], :float],
|
62
|
+
[:World_EnableWarmStarting, :b2World_EnableWarmStarting, [WorldId.by_value, :bool], :void],
|
63
|
+
[:World_IsWarmStartingEnabled, :b2World_IsWarmStartingEnabled, [WorldId.by_value], :bool],
|
64
|
+
[:World_GetAwakeBodyCount, :b2World_GetAwakeBodyCount, [WorldId.by_value], :int],
|
65
|
+
[:World_GetProfile, :b2World_GetProfile, [WorldId.by_value], Profile.by_value],
|
66
|
+
[:World_GetCounters, :b2World_GetCounters, [WorldId.by_value], Counters.by_value],
|
67
|
+
[:World_SetUserData, :b2World_SetUserData, [WorldId.by_value, :pointer], :void],
|
68
|
+
[:World_GetUserData, :b2World_GetUserData, [WorldId.by_value], :pointer],
|
69
|
+
[:World_DumpMemoryStats, :b2World_DumpMemoryStats, [WorldId.by_value], :void],
|
70
|
+
[:World_RebuildStaticTree, :b2World_RebuildStaticTree, [WorldId.by_value], :void],
|
71
|
+
[:World_EnableSpeculative, :b2World_EnableSpeculative, [WorldId.by_value, :bool], :void],
|
72
|
+
[:CreateBody, :b2CreateBody, [WorldId.by_value, :pointer], BodyId.by_value],
|
73
|
+
[:DestroyBody, :b2DestroyBody, [BodyId.by_value], :void],
|
74
|
+
[:Body_IsValid, :b2Body_IsValid, [BodyId.by_value], :bool],
|
75
|
+
[:Body_GetType, :b2Body_GetType, [BodyId.by_value], :int],
|
76
|
+
[:Body_SetType, :b2Body_SetType, [BodyId.by_value, :int], :void],
|
77
|
+
[:Body_SetUserData, :b2Body_SetUserData, [BodyId.by_value, :pointer], :void],
|
78
|
+
[:Body_GetUserData, :b2Body_GetUserData, [BodyId.by_value], :pointer],
|
79
|
+
[:Body_GetPosition, :b2Body_GetPosition, [BodyId.by_value], Vec2.by_value],
|
80
|
+
[:Body_GetRotation, :b2Body_GetRotation, [BodyId.by_value], Rot.by_value],
|
81
|
+
[:Body_GetTransform, :b2Body_GetTransform, [BodyId.by_value], Transform.by_value],
|
82
|
+
[:Body_SetTransform, :b2Body_SetTransform, [BodyId.by_value, Vec2.by_value, Rot.by_value], :void],
|
83
|
+
[:Body_GetLocalPoint, :b2Body_GetLocalPoint, [BodyId.by_value, Vec2.by_value], Vec2.by_value],
|
84
|
+
[:Body_GetWorldPoint, :b2Body_GetWorldPoint, [BodyId.by_value, Vec2.by_value], Vec2.by_value],
|
85
|
+
[:Body_GetLocalVector, :b2Body_GetLocalVector, [BodyId.by_value, Vec2.by_value], Vec2.by_value],
|
86
|
+
[:Body_GetWorldVector, :b2Body_GetWorldVector, [BodyId.by_value, Vec2.by_value], Vec2.by_value],
|
87
|
+
[:Body_GetLinearVelocity, :b2Body_GetLinearVelocity, [BodyId.by_value], Vec2.by_value],
|
88
|
+
[:Body_GetAngularVelocity, :b2Body_GetAngularVelocity, [BodyId.by_value], :float],
|
89
|
+
[:Body_SetLinearVelocity, :b2Body_SetLinearVelocity, [BodyId.by_value, Vec2.by_value], :void],
|
90
|
+
[:Body_SetAngularVelocity, :b2Body_SetAngularVelocity, [BodyId.by_value, :float], :void],
|
91
|
+
[:Body_ApplyForce, :b2Body_ApplyForce, [BodyId.by_value, Vec2.by_value, Vec2.by_value, :bool], :void],
|
92
|
+
[:Body_ApplyForceToCenter, :b2Body_ApplyForceToCenter, [BodyId.by_value, Vec2.by_value, :bool], :void],
|
93
|
+
[:Body_ApplyTorque, :b2Body_ApplyTorque, [BodyId.by_value, :float, :bool], :void],
|
94
|
+
[:Body_ApplyLinearImpulse, :b2Body_ApplyLinearImpulse, [BodyId.by_value, Vec2.by_value, Vec2.by_value, :bool], :void],
|
95
|
+
[:Body_ApplyLinearImpulseToCenter, :b2Body_ApplyLinearImpulseToCenter, [BodyId.by_value, Vec2.by_value, :bool], :void],
|
96
|
+
[:Body_ApplyAngularImpulse, :b2Body_ApplyAngularImpulse, [BodyId.by_value, :float, :bool], :void],
|
97
|
+
[:Body_GetMass, :b2Body_GetMass, [BodyId.by_value], :float],
|
98
|
+
[:Body_GetRotationalInertia, :b2Body_GetRotationalInertia, [BodyId.by_value], :float],
|
99
|
+
[:Body_GetLocalCenterOfMass, :b2Body_GetLocalCenterOfMass, [BodyId.by_value], Vec2.by_value],
|
100
|
+
[:Body_GetWorldCenterOfMass, :b2Body_GetWorldCenterOfMass, [BodyId.by_value], Vec2.by_value],
|
101
|
+
[:Body_SetMassData, :b2Body_SetMassData, [BodyId.by_value, MassData.by_value], :void],
|
102
|
+
[:Body_GetMassData, :b2Body_GetMassData, [BodyId.by_value], MassData.by_value],
|
103
|
+
[:Body_ApplyMassFromShapes, :b2Body_ApplyMassFromShapes, [BodyId.by_value], :void],
|
104
|
+
[:Body_SetLinearDamping, :b2Body_SetLinearDamping, [BodyId.by_value, :float], :void],
|
105
|
+
[:Body_GetLinearDamping, :b2Body_GetLinearDamping, [BodyId.by_value], :float],
|
106
|
+
[:Body_SetAngularDamping, :b2Body_SetAngularDamping, [BodyId.by_value, :float], :void],
|
107
|
+
[:Body_GetAngularDamping, :b2Body_GetAngularDamping, [BodyId.by_value], :float],
|
108
|
+
[:Body_SetGravityScale, :b2Body_SetGravityScale, [BodyId.by_value, :float], :void],
|
109
|
+
[:Body_GetGravityScale, :b2Body_GetGravityScale, [BodyId.by_value], :float],
|
110
|
+
[:Body_IsAwake, :b2Body_IsAwake, [BodyId.by_value], :bool],
|
111
|
+
[:Body_SetAwake, :b2Body_SetAwake, [BodyId.by_value, :bool], :void],
|
112
|
+
[:Body_EnableSleep, :b2Body_EnableSleep, [BodyId.by_value, :bool], :void],
|
113
|
+
[:Body_IsSleepEnabled, :b2Body_IsSleepEnabled, [BodyId.by_value], :bool],
|
114
|
+
[:Body_SetSleepThreshold, :b2Body_SetSleepThreshold, [BodyId.by_value, :float], :void],
|
115
|
+
[:Body_GetSleepThreshold, :b2Body_GetSleepThreshold, [BodyId.by_value], :float],
|
116
|
+
[:Body_IsEnabled, :b2Body_IsEnabled, [BodyId.by_value], :bool],
|
117
|
+
[:Body_Disable, :b2Body_Disable, [BodyId.by_value], :void],
|
118
|
+
[:Body_Enable, :b2Body_Enable, [BodyId.by_value], :void],
|
119
|
+
[:Body_SetFixedRotation, :b2Body_SetFixedRotation, [BodyId.by_value, :bool], :void],
|
120
|
+
[:Body_IsFixedRotation, :b2Body_IsFixedRotation, [BodyId.by_value], :bool],
|
121
|
+
[:Body_SetBullet, :b2Body_SetBullet, [BodyId.by_value, :bool], :void],
|
122
|
+
[:Body_IsBullet, :b2Body_IsBullet, [BodyId.by_value], :bool],
|
123
|
+
[:Body_EnableSensorEvents, :b2Body_EnableSensorEvents, [BodyId.by_value, :bool], :void],
|
124
|
+
[:Body_EnableContactEvents, :b2Body_EnableContactEvents, [BodyId.by_value, :bool], :void],
|
125
|
+
[:Body_EnableHitEvents, :b2Body_EnableHitEvents, [BodyId.by_value, :bool], :void],
|
126
|
+
[:Body_GetWorld, :b2Body_GetWorld, [BodyId.by_value], WorldId.by_value],
|
127
|
+
[:Body_GetShapeCount, :b2Body_GetShapeCount, [BodyId.by_value], :int],
|
128
|
+
[:Body_GetShapes, :b2Body_GetShapes, [BodyId.by_value, :pointer, :int], :int],
|
129
|
+
[:Body_GetJointCount, :b2Body_GetJointCount, [BodyId.by_value], :int],
|
130
|
+
[:Body_GetJoints, :b2Body_GetJoints, [BodyId.by_value, :pointer, :int], :int],
|
131
|
+
[:Body_GetContactCapacity, :b2Body_GetContactCapacity, [BodyId.by_value], :int],
|
132
|
+
[:Body_GetContactData, :b2Body_GetContactData, [BodyId.by_value, :pointer, :int], :int],
|
133
|
+
[:Body_ComputeAABB, :b2Body_ComputeAABB, [BodyId.by_value], AABB.by_value],
|
134
|
+
[:CreateCircleShape, :b2CreateCircleShape, [BodyId.by_value, :pointer, :pointer], ShapeId.by_value],
|
135
|
+
[:CreateSegmentShape, :b2CreateSegmentShape, [BodyId.by_value, :pointer, :pointer], ShapeId.by_value],
|
136
|
+
[:CreateCapsuleShape, :b2CreateCapsuleShape, [BodyId.by_value, :pointer, :pointer], ShapeId.by_value],
|
137
|
+
[:CreatePolygonShape, :b2CreatePolygonShape, [BodyId.by_value, :pointer, :pointer], ShapeId.by_value],
|
138
|
+
[:DestroyShape, :b2DestroyShape, [ShapeId.by_value, :bool], :void],
|
139
|
+
[:Shape_IsValid, :b2Shape_IsValid, [ShapeId.by_value], :bool],
|
140
|
+
[:Shape_GetType, :b2Shape_GetType, [ShapeId.by_value], :int],
|
141
|
+
[:Shape_GetBody, :b2Shape_GetBody, [ShapeId.by_value], BodyId.by_value],
|
142
|
+
[:Shape_GetWorld, :b2Shape_GetWorld, [ShapeId.by_value], WorldId.by_value],
|
143
|
+
[:Shape_IsSensor, :b2Shape_IsSensor, [ShapeId.by_value], :bool],
|
144
|
+
[:Shape_SetUserData, :b2Shape_SetUserData, [ShapeId.by_value, :pointer], :void],
|
145
|
+
[:Shape_GetUserData, :b2Shape_GetUserData, [ShapeId.by_value], :pointer],
|
146
|
+
[:Shape_SetDensity, :b2Shape_SetDensity, [ShapeId.by_value, :float, :bool], :void],
|
147
|
+
[:Shape_GetDensity, :b2Shape_GetDensity, [ShapeId.by_value], :float],
|
148
|
+
[:Shape_SetFriction, :b2Shape_SetFriction, [ShapeId.by_value, :float], :void],
|
149
|
+
[:Shape_GetFriction, :b2Shape_GetFriction, [ShapeId.by_value], :float],
|
150
|
+
[:Shape_SetRestitution, :b2Shape_SetRestitution, [ShapeId.by_value, :float], :void],
|
151
|
+
[:Shape_GetRestitution, :b2Shape_GetRestitution, [ShapeId.by_value], :float],
|
152
|
+
[:Shape_GetFilter, :b2Shape_GetFilter, [ShapeId.by_value], Filter.by_value],
|
153
|
+
[:Shape_SetFilter, :b2Shape_SetFilter, [ShapeId.by_value, Filter.by_value], :void],
|
154
|
+
[:Shape_EnableSensorEvents, :b2Shape_EnableSensorEvents, [ShapeId.by_value, :bool], :void],
|
155
|
+
[:Shape_AreSensorEventsEnabled, :b2Shape_AreSensorEventsEnabled, [ShapeId.by_value], :bool],
|
156
|
+
[:Shape_EnableContactEvents, :b2Shape_EnableContactEvents, [ShapeId.by_value, :bool], :void],
|
157
|
+
[:Shape_AreContactEventsEnabled, :b2Shape_AreContactEventsEnabled, [ShapeId.by_value], :bool],
|
158
|
+
[:Shape_EnablePreSolveEvents, :b2Shape_EnablePreSolveEvents, [ShapeId.by_value, :bool], :void],
|
159
|
+
[:Shape_ArePreSolveEventsEnabled, :b2Shape_ArePreSolveEventsEnabled, [ShapeId.by_value], :bool],
|
160
|
+
[:Shape_EnableHitEvents, :b2Shape_EnableHitEvents, [ShapeId.by_value, :bool], :void],
|
161
|
+
[:Shape_AreHitEventsEnabled, :b2Shape_AreHitEventsEnabled, [ShapeId.by_value], :bool],
|
162
|
+
[:Shape_TestPoint, :b2Shape_TestPoint, [ShapeId.by_value, Vec2.by_value], :bool],
|
163
|
+
[:Shape_RayCast, :b2Shape_RayCast, [ShapeId.by_value, :pointer], CastOutput.by_value],
|
164
|
+
[:Shape_GetCircle, :b2Shape_GetCircle, [ShapeId.by_value], Circle.by_value],
|
165
|
+
[:Shape_GetSegment, :b2Shape_GetSegment, [ShapeId.by_value], Segment.by_value],
|
166
|
+
[:Shape_GetChainSegment, :b2Shape_GetChainSegment, [ShapeId.by_value], ChainSegment.by_value],
|
167
|
+
[:Shape_GetCapsule, :b2Shape_GetCapsule, [ShapeId.by_value], Capsule.by_value],
|
168
|
+
[:Shape_GetPolygon, :b2Shape_GetPolygon, [ShapeId.by_value], Polygon.by_value],
|
169
|
+
[:Shape_SetCircle, :b2Shape_SetCircle, [ShapeId.by_value, :pointer], :void],
|
170
|
+
[:Shape_SetCapsule, :b2Shape_SetCapsule, [ShapeId.by_value, :pointer], :void],
|
171
|
+
[:Shape_SetSegment, :b2Shape_SetSegment, [ShapeId.by_value, :pointer], :void],
|
172
|
+
[:Shape_SetPolygon, :b2Shape_SetPolygon, [ShapeId.by_value, :pointer], :void],
|
173
|
+
[:Shape_GetParentChain, :b2Shape_GetParentChain, [ShapeId.by_value], ChainId.by_value],
|
174
|
+
[:Shape_GetContactCapacity, :b2Shape_GetContactCapacity, [ShapeId.by_value], :int],
|
175
|
+
[:Shape_GetContactData, :b2Shape_GetContactData, [ShapeId.by_value, :pointer, :int], :int],
|
176
|
+
[:Shape_GetSensorCapacity, :b2Shape_GetSensorCapacity, [ShapeId.by_value], :int],
|
177
|
+
[:Shape_GetSensorOverlaps, :b2Shape_GetSensorOverlaps, [ShapeId.by_value, :pointer, :int], :int],
|
178
|
+
[:Shape_GetAABB, :b2Shape_GetAABB, [ShapeId.by_value], AABB.by_value],
|
179
|
+
[:Shape_GetClosestPoint, :b2Shape_GetClosestPoint, [ShapeId.by_value, Vec2.by_value], Vec2.by_value],
|
180
|
+
[:CreateChain, :b2CreateChain, [BodyId.by_value, :pointer], ChainId.by_value],
|
181
|
+
[:DestroyChain, :b2DestroyChain, [ChainId.by_value], :void],
|
182
|
+
[:Chain_GetWorld, :b2Chain_GetWorld, [ChainId.by_value], WorldId.by_value],
|
183
|
+
[:Chain_GetSegmentCount, :b2Chain_GetSegmentCount, [ChainId.by_value], :int],
|
184
|
+
[:Chain_GetSegments, :b2Chain_GetSegments, [ChainId.by_value, :pointer, :int], :int],
|
185
|
+
[:Chain_SetFriction, :b2Chain_SetFriction, [ChainId.by_value, :float], :void],
|
186
|
+
[:Chain_GetFriction, :b2Chain_GetFriction, [ChainId.by_value], :float],
|
187
|
+
[:Chain_SetRestitution, :b2Chain_SetRestitution, [ChainId.by_value, :float], :void],
|
188
|
+
[:Chain_GetRestitution, :b2Chain_GetRestitution, [ChainId.by_value], :float],
|
189
|
+
[:Chain_IsValid, :b2Chain_IsValid, [ChainId.by_value], :bool],
|
190
|
+
[:DestroyJoint, :b2DestroyJoint, [JointId.by_value], :void],
|
191
|
+
[:Joint_IsValid, :b2Joint_IsValid, [JointId.by_value], :bool],
|
192
|
+
[:Joint_GetType, :b2Joint_GetType, [JointId.by_value], :int],
|
193
|
+
[:Joint_GetBodyA, :b2Joint_GetBodyA, [JointId.by_value], BodyId.by_value],
|
194
|
+
[:Joint_GetBodyB, :b2Joint_GetBodyB, [JointId.by_value], BodyId.by_value],
|
195
|
+
[:Joint_GetWorld, :b2Joint_GetWorld, [JointId.by_value], WorldId.by_value],
|
196
|
+
[:Joint_GetLocalAnchorA, :b2Joint_GetLocalAnchorA, [JointId.by_value], Vec2.by_value],
|
197
|
+
[:Joint_GetLocalAnchorB, :b2Joint_GetLocalAnchorB, [JointId.by_value], Vec2.by_value],
|
198
|
+
[:Joint_SetCollideConnected, :b2Joint_SetCollideConnected, [JointId.by_value, :bool], :void],
|
199
|
+
[:Joint_GetCollideConnected, :b2Joint_GetCollideConnected, [JointId.by_value], :bool],
|
200
|
+
[:Joint_SetUserData, :b2Joint_SetUserData, [JointId.by_value, :pointer], :void],
|
201
|
+
[:Joint_GetUserData, :b2Joint_GetUserData, [JointId.by_value], :pointer],
|
202
|
+
[:Joint_WakeBodies, :b2Joint_WakeBodies, [JointId.by_value], :void],
|
203
|
+
[:Joint_GetConstraintForce, :b2Joint_GetConstraintForce, [JointId.by_value], Vec2.by_value],
|
204
|
+
[:Joint_GetConstraintTorque, :b2Joint_GetConstraintTorque, [JointId.by_value], :float],
|
205
|
+
[:CreateDistanceJoint, :b2CreateDistanceJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
206
|
+
[:DistanceJoint_SetLength, :b2DistanceJoint_SetLength, [JointId.by_value, :float], :void],
|
207
|
+
[:DistanceJoint_GetLength, :b2DistanceJoint_GetLength, [JointId.by_value], :float],
|
208
|
+
[:DistanceJoint_EnableSpring, :b2DistanceJoint_EnableSpring, [JointId.by_value, :bool], :void],
|
209
|
+
[:DistanceJoint_IsSpringEnabled, :b2DistanceJoint_IsSpringEnabled, [JointId.by_value], :bool],
|
210
|
+
[:DistanceJoint_SetSpringHertz, :b2DistanceJoint_SetSpringHertz, [JointId.by_value, :float], :void],
|
211
|
+
[:DistanceJoint_SetSpringDampingRatio, :b2DistanceJoint_SetSpringDampingRatio, [JointId.by_value, :float], :void],
|
212
|
+
[:DistanceJoint_GetSpringHertz, :b2DistanceJoint_GetSpringHertz, [JointId.by_value], :float],
|
213
|
+
[:DistanceJoint_GetSpringDampingRatio, :b2DistanceJoint_GetSpringDampingRatio, [JointId.by_value], :float],
|
214
|
+
[:DistanceJoint_EnableLimit, :b2DistanceJoint_EnableLimit, [JointId.by_value, :bool], :void],
|
215
|
+
[:DistanceJoint_IsLimitEnabled, :b2DistanceJoint_IsLimitEnabled, [JointId.by_value], :bool],
|
216
|
+
[:DistanceJoint_SetLengthRange, :b2DistanceJoint_SetLengthRange, [JointId.by_value, :float, :float], :void],
|
217
|
+
[:DistanceJoint_GetMinLength, :b2DistanceJoint_GetMinLength, [JointId.by_value], :float],
|
218
|
+
[:DistanceJoint_GetMaxLength, :b2DistanceJoint_GetMaxLength, [JointId.by_value], :float],
|
219
|
+
[:DistanceJoint_GetCurrentLength, :b2DistanceJoint_GetCurrentLength, [JointId.by_value], :float],
|
220
|
+
[:DistanceJoint_EnableMotor, :b2DistanceJoint_EnableMotor, [JointId.by_value, :bool], :void],
|
221
|
+
[:DistanceJoint_IsMotorEnabled, :b2DistanceJoint_IsMotorEnabled, [JointId.by_value], :bool],
|
222
|
+
[:DistanceJoint_SetMotorSpeed, :b2DistanceJoint_SetMotorSpeed, [JointId.by_value, :float], :void],
|
223
|
+
[:DistanceJoint_GetMotorSpeed, :b2DistanceJoint_GetMotorSpeed, [JointId.by_value], :float],
|
224
|
+
[:DistanceJoint_SetMaxMotorForce, :b2DistanceJoint_SetMaxMotorForce, [JointId.by_value, :float], :void],
|
225
|
+
[:DistanceJoint_GetMaxMotorForce, :b2DistanceJoint_GetMaxMotorForce, [JointId.by_value], :float],
|
226
|
+
[:DistanceJoint_GetMotorForce, :b2DistanceJoint_GetMotorForce, [JointId.by_value], :float],
|
227
|
+
[:CreateMotorJoint, :b2CreateMotorJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
228
|
+
[:MotorJoint_SetLinearOffset, :b2MotorJoint_SetLinearOffset, [JointId.by_value, Vec2.by_value], :void],
|
229
|
+
[:MotorJoint_GetLinearOffset, :b2MotorJoint_GetLinearOffset, [JointId.by_value], Vec2.by_value],
|
230
|
+
[:MotorJoint_SetAngularOffset, :b2MotorJoint_SetAngularOffset, [JointId.by_value, :float], :void],
|
231
|
+
[:MotorJoint_GetAngularOffset, :b2MotorJoint_GetAngularOffset, [JointId.by_value], :float],
|
232
|
+
[:MotorJoint_SetMaxForce, :b2MotorJoint_SetMaxForce, [JointId.by_value, :float], :void],
|
233
|
+
[:MotorJoint_GetMaxForce, :b2MotorJoint_GetMaxForce, [JointId.by_value], :float],
|
234
|
+
[:MotorJoint_SetMaxTorque, :b2MotorJoint_SetMaxTorque, [JointId.by_value, :float], :void],
|
235
|
+
[:MotorJoint_GetMaxTorque, :b2MotorJoint_GetMaxTorque, [JointId.by_value], :float],
|
236
|
+
[:MotorJoint_SetCorrectionFactor, :b2MotorJoint_SetCorrectionFactor, [JointId.by_value, :float], :void],
|
237
|
+
[:MotorJoint_GetCorrectionFactor, :b2MotorJoint_GetCorrectionFactor, [JointId.by_value], :float],
|
238
|
+
[:CreateMouseJoint, :b2CreateMouseJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
239
|
+
[:MouseJoint_SetTarget, :b2MouseJoint_SetTarget, [JointId.by_value, Vec2.by_value], :void],
|
240
|
+
[:MouseJoint_GetTarget, :b2MouseJoint_GetTarget, [JointId.by_value], Vec2.by_value],
|
241
|
+
[:MouseJoint_SetSpringHertz, :b2MouseJoint_SetSpringHertz, [JointId.by_value, :float], :void],
|
242
|
+
[:MouseJoint_GetSpringHertz, :b2MouseJoint_GetSpringHertz, [JointId.by_value], :float],
|
243
|
+
[:MouseJoint_SetSpringDampingRatio, :b2MouseJoint_SetSpringDampingRatio, [JointId.by_value, :float], :void],
|
244
|
+
[:MouseJoint_GetSpringDampingRatio, :b2MouseJoint_GetSpringDampingRatio, [JointId.by_value], :float],
|
245
|
+
[:MouseJoint_SetMaxForce, :b2MouseJoint_SetMaxForce, [JointId.by_value, :float], :void],
|
246
|
+
[:MouseJoint_GetMaxForce, :b2MouseJoint_GetMaxForce, [JointId.by_value], :float],
|
247
|
+
[:CreateNullJoint, :b2CreateNullJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
248
|
+
[:CreatePrismaticJoint, :b2CreatePrismaticJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
249
|
+
[:PrismaticJoint_EnableSpring, :b2PrismaticJoint_EnableSpring, [JointId.by_value, :bool], :void],
|
250
|
+
[:PrismaticJoint_IsSpringEnabled, :b2PrismaticJoint_IsSpringEnabled, [JointId.by_value], :bool],
|
251
|
+
[:PrismaticJoint_SetSpringHertz, :b2PrismaticJoint_SetSpringHertz, [JointId.by_value, :float], :void],
|
252
|
+
[:PrismaticJoint_GetSpringHertz, :b2PrismaticJoint_GetSpringHertz, [JointId.by_value], :float],
|
253
|
+
[:PrismaticJoint_SetSpringDampingRatio, :b2PrismaticJoint_SetSpringDampingRatio, [JointId.by_value, :float], :void],
|
254
|
+
[:PrismaticJoint_GetSpringDampingRatio, :b2PrismaticJoint_GetSpringDampingRatio, [JointId.by_value], :float],
|
255
|
+
[:PrismaticJoint_EnableLimit, :b2PrismaticJoint_EnableLimit, [JointId.by_value, :bool], :void],
|
256
|
+
[:PrismaticJoint_IsLimitEnabled, :b2PrismaticJoint_IsLimitEnabled, [JointId.by_value], :bool],
|
257
|
+
[:PrismaticJoint_GetLowerLimit, :b2PrismaticJoint_GetLowerLimit, [JointId.by_value], :float],
|
258
|
+
[:PrismaticJoint_GetUpperLimit, :b2PrismaticJoint_GetUpperLimit, [JointId.by_value], :float],
|
259
|
+
[:PrismaticJoint_SetLimits, :b2PrismaticJoint_SetLimits, [JointId.by_value, :float, :float], :void],
|
260
|
+
[:PrismaticJoint_EnableMotor, :b2PrismaticJoint_EnableMotor, [JointId.by_value, :bool], :void],
|
261
|
+
[:PrismaticJoint_IsMotorEnabled, :b2PrismaticJoint_IsMotorEnabled, [JointId.by_value], :bool],
|
262
|
+
[:PrismaticJoint_SetMotorSpeed, :b2PrismaticJoint_SetMotorSpeed, [JointId.by_value, :float], :void],
|
263
|
+
[:PrismaticJoint_GetMotorSpeed, :b2PrismaticJoint_GetMotorSpeed, [JointId.by_value], :float],
|
264
|
+
[:PrismaticJoint_SetMaxMotorForce, :b2PrismaticJoint_SetMaxMotorForce, [JointId.by_value, :float], :void],
|
265
|
+
[:PrismaticJoint_GetMaxMotorForce, :b2PrismaticJoint_GetMaxMotorForce, [JointId.by_value], :float],
|
266
|
+
[:PrismaticJoint_GetMotorForce, :b2PrismaticJoint_GetMotorForce, [JointId.by_value], :float],
|
267
|
+
[:PrismaticJoint_GetTranslation, :b2PrismaticJoint_GetTranslation, [JointId.by_value], :float],
|
268
|
+
[:PrismaticJoint_GetSpeed, :b2PrismaticJoint_GetSpeed, [JointId.by_value], :float],
|
269
|
+
[:CreateRevoluteJoint, :b2CreateRevoluteJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
270
|
+
[:RevoluteJoint_EnableSpring, :b2RevoluteJoint_EnableSpring, [JointId.by_value, :bool], :void],
|
271
|
+
[:RevoluteJoint_IsSpringEnabled, :b2RevoluteJoint_IsSpringEnabled, [JointId.by_value], :bool],
|
272
|
+
[:RevoluteJoint_SetSpringHertz, :b2RevoluteJoint_SetSpringHertz, [JointId.by_value, :float], :void],
|
273
|
+
[:RevoluteJoint_GetSpringHertz, :b2RevoluteJoint_GetSpringHertz, [JointId.by_value], :float],
|
274
|
+
[:RevoluteJoint_SetSpringDampingRatio, :b2RevoluteJoint_SetSpringDampingRatio, [JointId.by_value, :float], :void],
|
275
|
+
[:RevoluteJoint_GetSpringDampingRatio, :b2RevoluteJoint_GetSpringDampingRatio, [JointId.by_value], :float],
|
276
|
+
[:RevoluteJoint_GetAngle, :b2RevoluteJoint_GetAngle, [JointId.by_value], :float],
|
277
|
+
[:RevoluteJoint_EnableLimit, :b2RevoluteJoint_EnableLimit, [JointId.by_value, :bool], :void],
|
278
|
+
[:RevoluteJoint_IsLimitEnabled, :b2RevoluteJoint_IsLimitEnabled, [JointId.by_value], :bool],
|
279
|
+
[:RevoluteJoint_GetLowerLimit, :b2RevoluteJoint_GetLowerLimit, [JointId.by_value], :float],
|
280
|
+
[:RevoluteJoint_GetUpperLimit, :b2RevoluteJoint_GetUpperLimit, [JointId.by_value], :float],
|
281
|
+
[:RevoluteJoint_SetLimits, :b2RevoluteJoint_SetLimits, [JointId.by_value, :float, :float], :void],
|
282
|
+
[:RevoluteJoint_EnableMotor, :b2RevoluteJoint_EnableMotor, [JointId.by_value, :bool], :void],
|
283
|
+
[:RevoluteJoint_IsMotorEnabled, :b2RevoluteJoint_IsMotorEnabled, [JointId.by_value], :bool],
|
284
|
+
[:RevoluteJoint_SetMotorSpeed, :b2RevoluteJoint_SetMotorSpeed, [JointId.by_value, :float], :void],
|
285
|
+
[:RevoluteJoint_GetMotorSpeed, :b2RevoluteJoint_GetMotorSpeed, [JointId.by_value], :float],
|
286
|
+
[:RevoluteJoint_GetMotorTorque, :b2RevoluteJoint_GetMotorTorque, [JointId.by_value], :float],
|
287
|
+
[:RevoluteJoint_SetMaxMotorTorque, :b2RevoluteJoint_SetMaxMotorTorque, [JointId.by_value, :float], :void],
|
288
|
+
[:RevoluteJoint_GetMaxMotorTorque, :b2RevoluteJoint_GetMaxMotorTorque, [JointId.by_value], :float],
|
289
|
+
[:CreateWeldJoint, :b2CreateWeldJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
290
|
+
[:WeldJoint_GetReferenceAngle, :b2WeldJoint_GetReferenceAngle, [JointId.by_value], :float],
|
291
|
+
[:WeldJoint_SetReferenceAngle, :b2WeldJoint_SetReferenceAngle, [JointId.by_value, :float], :void],
|
292
|
+
[:WeldJoint_SetLinearHertz, :b2WeldJoint_SetLinearHertz, [JointId.by_value, :float], :void],
|
293
|
+
[:WeldJoint_GetLinearHertz, :b2WeldJoint_GetLinearHertz, [JointId.by_value], :float],
|
294
|
+
[:WeldJoint_SetLinearDampingRatio, :b2WeldJoint_SetLinearDampingRatio, [JointId.by_value, :float], :void],
|
295
|
+
[:WeldJoint_GetLinearDampingRatio, :b2WeldJoint_GetLinearDampingRatio, [JointId.by_value], :float],
|
296
|
+
[:WeldJoint_SetAngularHertz, :b2WeldJoint_SetAngularHertz, [JointId.by_value, :float], :void],
|
297
|
+
[:WeldJoint_GetAngularHertz, :b2WeldJoint_GetAngularHertz, [JointId.by_value], :float],
|
298
|
+
[:WeldJoint_SetAngularDampingRatio, :b2WeldJoint_SetAngularDampingRatio, [JointId.by_value, :float], :void],
|
299
|
+
[:WeldJoint_GetAngularDampingRatio, :b2WeldJoint_GetAngularDampingRatio, [JointId.by_value], :float],
|
300
|
+
[:CreateWheelJoint, :b2CreateWheelJoint, [WorldId.by_value, :pointer], JointId.by_value],
|
301
|
+
[:WheelJoint_EnableSpring, :b2WheelJoint_EnableSpring, [JointId.by_value, :bool], :void],
|
302
|
+
[:WheelJoint_IsSpringEnabled, :b2WheelJoint_IsSpringEnabled, [JointId.by_value], :bool],
|
303
|
+
[:WheelJoint_SetSpringHertz, :b2WheelJoint_SetSpringHertz, [JointId.by_value, :float], :void],
|
304
|
+
[:WheelJoint_GetSpringHertz, :b2WheelJoint_GetSpringHertz, [JointId.by_value], :float],
|
305
|
+
[:WheelJoint_SetSpringDampingRatio, :b2WheelJoint_SetSpringDampingRatio, [JointId.by_value, :float], :void],
|
306
|
+
[:WheelJoint_GetSpringDampingRatio, :b2WheelJoint_GetSpringDampingRatio, [JointId.by_value], :float],
|
307
|
+
[:WheelJoint_EnableLimit, :b2WheelJoint_EnableLimit, [JointId.by_value, :bool], :void],
|
308
|
+
[:WheelJoint_IsLimitEnabled, :b2WheelJoint_IsLimitEnabled, [JointId.by_value], :bool],
|
309
|
+
[:WheelJoint_GetLowerLimit, :b2WheelJoint_GetLowerLimit, [JointId.by_value], :float],
|
310
|
+
[:WheelJoint_GetUpperLimit, :b2WheelJoint_GetUpperLimit, [JointId.by_value], :float],
|
311
|
+
[:WheelJoint_SetLimits, :b2WheelJoint_SetLimits, [JointId.by_value, :float, :float], :void],
|
312
|
+
[:WheelJoint_EnableMotor, :b2WheelJoint_EnableMotor, [JointId.by_value, :bool], :void],
|
313
|
+
[:WheelJoint_IsMotorEnabled, :b2WheelJoint_IsMotorEnabled, [JointId.by_value], :bool],
|
314
|
+
[:WheelJoint_SetMotorSpeed, :b2WheelJoint_SetMotorSpeed, [JointId.by_value, :float], :void],
|
315
|
+
[:WheelJoint_GetMotorSpeed, :b2WheelJoint_GetMotorSpeed, [JointId.by_value], :float],
|
316
|
+
[:WheelJoint_SetMaxMotorTorque, :b2WheelJoint_SetMaxMotorTorque, [JointId.by_value, :float], :void],
|
317
|
+
[:WheelJoint_GetMaxMotorTorque, :b2WheelJoint_GetMaxMotorTorque, [JointId.by_value], :float],
|
318
|
+
[:WheelJoint_GetMotorTorque, :b2WheelJoint_GetMotorTorque, [JointId.by_value], :float],
|
319
|
+
]
|
320
|
+
entries.each do |entry|
|
321
|
+
api_name = if method_naming == :snake_case
|
322
|
+
snake_case_name = entry[0].to_s.gsub(/([A-Z]+)([A-Z0-9][a-z])/, '\1_\2').gsub(/([a-z\d])([A-Z0-9])/, '\1_\2').downcase
|
323
|
+
snake_case_name.gsub!('vector_3', 'vector3_') if snake_case_name.include?('vector_3')
|
324
|
+
snake_case_name.gsub!('vector_2', 'vector2_') if snake_case_name.include?('vector_2')
|
325
|
+
snake_case_name.chop! if snake_case_name.end_with?('_')
|
326
|
+
snake_case_name.to_sym
|
327
|
+
else
|
328
|
+
entry[0]
|
329
|
+
end
|
330
|
+
attach_function api_name, entry[1], entry[2], entry[3]
|
331
|
+
rescue FFI::NotFoundError => e
|
332
|
+
warn "[Warning] Failed to import #{entry[0]} (#{e})."
|
333
|
+
end
|
334
|
+
end
|
335
|
+
|
336
|
+
end
|
337
|
+
|