box2d-bindings 0.1.2-x64-mingw → 0.1.4-x64-mingw

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.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: a37ed681813f87185cf250a9deb718cac5d823a9964da748497beef4f9af3ddf
4
- data.tar.gz: 4a12e726c72ba0bf0f13d1777c3a873ff68764804ff8bbde4dd1a6d1e955e7a9
3
+ metadata.gz: edcd574aef18044351b3232aad26f2e97679cb955dc86821679b2ea09a772988
4
+ data.tar.gz: d26ffb7209252a2816474c0f4990c2a1af3c6f1a546a8d83dd2dea9b7b3757eb
5
5
  SHA512:
6
- metadata.gz: c7b304b4a610b63d6d56c6a75ff90232786220e4de7fbe7568c67adf2ac8a85e1e8ec85320c4513b56e2c6abe5ed77a1ca6bbb88398a5e95046423367c1a9169
7
- data.tar.gz: d48c3e377753c42da1fbdb41ec9c3ecbc53721ffe9f429ac5f30dd56a8a329bdf133574fa7bfa3034f4f85fc56ec9914cf5bd7889b6590b13b6ffd1c55e42075
6
+ metadata.gz: 0cba1ff1b419bf58c4d8fe86dca79305f1474fab51f31605fb5474fc583141cbd5c2e9bcaabb007f3fb30e96cc82d0bc0fbc9d6592f3ed4c53f5822eb0655b89
7
+ data.tar.gz: 31967d2376056298e5c78f36dacf259ae51dca10ffa9c62930c7c19b62520bd022abcb095d17679b34fc8b5fcebbdb8e66a3502bd189fa214edc42063bc83d23
data/ChangeLog CHANGED
@@ -1,3 +1,16 @@
1
+ 2025-12-29 vaiorabbit <http://twitter.com/vaiorabbit>
2
+
3
+ * https://github.com/erincatto/box2d/commit/c05c48738fbe5c27625e36c5f0cfbdaddfc8359a
4
+ * Added sample_pegs.rb
5
+
6
+ 2025-07-13 vaiorabbit <http://twitter.com/vaiorabbit>
7
+
8
+ * https://github.com/erincatto/box2d/commit/fb8b81f03f126ff52db5ebd25c90928fb56528d5
9
+
10
+ 2025-06-06 vaiorabbit <http://twitter.com/vaiorabbit>
11
+
12
+ * https://github.com/erincatto/box2d/commit/d3d2b926c6694f46f8d511ee90cb3f553bf488b2
13
+
1
14
  2025-05-11 vaiorabbit <http://twitter.com/vaiorabbit>
2
15
 
3
16
  * https://github.com/erincatto/box2d/commit/2d088533b921e912c18c654f8b46c43e04ad0ca8
data/LICENSE.txt CHANGED
@@ -1,5 +1,5 @@
1
1
  Ruby-Box2D : Box2D bindings for Ruby
2
- Copyright (c) 2024-2025 vaiorabbit <http://twitter.com/vaiorabbit>
2
+ Copyright (c) 2024-2026 vaiorabbit <http://twitter.com/vaiorabbit>
3
3
 
4
4
  This software is provided 'as-is', without any express or implied
5
5
  warranty. In no event will the authors be held liable for any damages
data/README.md CHANGED
@@ -3,7 +3,7 @@
3
3
  # Box2D bindings for Ruby #
4
4
 
5
5
  * Created : 2024-08-18
6
- * Last modified : 2025-05-11
6
+ * Last modified : 2026-01-10
7
7
 
8
8
  Provides Ruby bindings for Box2D
9
9
  * https://box2d.org
@@ -27,7 +27,7 @@ All ruby codes here are available under the zlib/libpng License ( http://opensou
27
27
 
28
28
  ```
29
29
  Ruby-Box2D : Box2D bindings for Ruby
30
- Copyright (c) 2024-2025 vaiorabbit <http://twitter.com/vaiorabbit>
30
+ Copyright (c) 2024-2026 vaiorabbit <http://twitter.com/vaiorabbit>
31
31
 
32
32
  This software is provided 'as-is', without any express or implied
33
33
  warranty. In no event will the authors be held liable for any damages
data/lib/box2d_base.rb CHANGED
@@ -20,6 +20,7 @@ module Box2D
20
20
  typedef :pointer, :b2AllocFcn
21
21
  typedef :pointer, :b2FreeFcn
22
22
  typedef :pointer, :b2AssertFcn
23
+ typedef :pointer, :b2LogFcn
23
24
 
24
25
  # Struct
25
26
 
@@ -52,8 +53,8 @@ module Box2D
52
53
  [:SetAllocator, :b2SetAllocator, [:pointer, :pointer], :void],
53
54
  [:GetByteCount, :b2GetByteCount, [], :int],
54
55
  [:SetAssertFcn, :b2SetAssertFcn, [:pointer], :void],
56
+ [:SetLogFcn, :b2SetLogFcn, [:pointer], :void],
55
57
  [:GetVersion, :b2GetVersion, [], Version.by_value],
56
- [:InternalAssertFcn, :b2InternalAssertFcn, [:pointer, :pointer, :int], :int],
57
58
  [:GetTicks, :b2GetTicks, [], :ulong_long],
58
59
  [:GetMilliseconds, :b2GetMilliseconds, [:ulong_long], :float],
59
60
  [:GetMillisecondsAndReset, :b2GetMillisecondsAndReset, [:pointer], :float],
@@ -593,15 +593,23 @@ module Box2D
593
593
  class TOIOutput < FFI::Struct
594
594
  layout(
595
595
  :state, :int,
596
+ :point, Vec2,
597
+ :normal, Vec2,
596
598
  :fraction, :float,
597
599
  )
598
600
  def state = self[:state]
599
601
  def state=(v) self[:state] = v end
602
+ def point = self[:point]
603
+ def point=(v) self[:point] = v end
604
+ def normal = self[:normal]
605
+ def normal=(v) self[:normal] = v end
600
606
  def fraction = self[:fraction]
601
607
  def fraction=(v) self[:fraction] = v end
602
- def self.create_as(_state_, _fraction_)
608
+ def self.create_as(_state_, _point_, _normal_, _fraction_)
603
609
  instance = TOIOutput.new
604
610
  instance[:state] = _state_
611
+ instance[:point] = _point_
612
+ instance[:normal] = _normal_
605
613
  instance[:fraction] = _fraction_
606
614
  instance
607
615
  end
@@ -799,16 +807,16 @@ module Box2D
799
807
 
800
808
  class PlaneSolverResult < FFI::Struct
801
809
  layout(
802
- :position, Vec2,
810
+ :translation, Vec2,
803
811
  :iterationCount, :int,
804
812
  )
805
- def position = self[:position]
806
- def position=(v) self[:position] = v end
813
+ def translation = self[:translation]
814
+ def translation=(v) self[:translation] = v end
807
815
  def iterationCount = self[:iterationCount]
808
816
  def iterationCount=(v) self[:iterationCount] = v end
809
- def self.create_as(_position_, _iterationCount_)
817
+ def self.create_as(_translation_, _iterationCount_)
810
818
  instance = PlaneSolverResult.new
811
- instance[:position] = _position_
819
+ instance[:translation] = _translation_
812
820
  instance[:iterationCount] = _iterationCount_
813
821
  instance
814
822
  end
@@ -836,9 +844,9 @@ module Box2D
836
844
  [:ComputeCapsuleAABB, :b2ComputeCapsuleAABB, [:pointer, Transform.by_value], AABB.by_value],
837
845
  [:ComputePolygonAABB, :b2ComputePolygonAABB, [:pointer, Transform.by_value], AABB.by_value],
838
846
  [:ComputeSegmentAABB, :b2ComputeSegmentAABB, [:pointer, Transform.by_value], AABB.by_value],
839
- [:PointInCircle, :b2PointInCircle, [Vec2.by_value, :pointer], :bool],
840
- [:PointInCapsule, :b2PointInCapsule, [Vec2.by_value, :pointer], :bool],
841
- [:PointInPolygon, :b2PointInPolygon, [Vec2.by_value, :pointer], :bool],
847
+ [:PointInCircle, :b2PointInCircle, [:pointer, Vec2.by_value], :bool],
848
+ [:PointInCapsule, :b2PointInCapsule, [:pointer, Vec2.by_value], :bool],
849
+ [:PointInPolygon, :b2PointInPolygon, [:pointer, Vec2.by_value], :bool],
842
850
  [:RayCastCircle, :b2RayCastCircle, [:pointer, :pointer], CastOutput.by_value],
843
851
  [:RayCastCapsule, :b2RayCastCapsule, [:pointer, :pointer], CastOutput.by_value],
844
852
  [:RayCastSegment, :b2RayCastSegment, [:pointer, :pointer, :bool], CastOutput.by_value],
@@ -877,6 +885,7 @@ module Box2D
877
885
  [:DynamicTree_SetCategoryBits, :b2DynamicTree_SetCategoryBits, [:pointer, :int, :ulong_long], :void],
878
886
  [:DynamicTree_GetCategoryBits, :b2DynamicTree_GetCategoryBits, [:pointer, :int], :ulong_long],
879
887
  [:DynamicTree_Query, :b2DynamicTree_Query, [:pointer, AABB.by_value, :ulong_long, :pointer, :pointer], TreeStats.by_value],
888
+ [:DynamicTree_QueryAll, :b2DynamicTree_QueryAll, [:pointer, AABB.by_value, :pointer, :pointer], TreeStats.by_value],
880
889
  [:DynamicTree_RayCast, :b2DynamicTree_RayCast, [:pointer, :pointer, :ulong_long, :pointer, :pointer], TreeStats.by_value],
881
890
  [:DynamicTree_ShapeCast, :b2DynamicTree_ShapeCast, [:pointer, :pointer, :ulong_long, :pointer, :pointer], TreeStats.by_value],
882
891
  [:DynamicTree_GetHeight, :b2DynamicTree_GetHeight, [:pointer], :int],
data/lib/box2d_id.rb CHANGED
@@ -120,6 +120,31 @@ module Box2D
120
120
  end
121
121
  end
122
122
 
123
+ class ContactId < FFI::Struct
124
+ layout(
125
+ :index1, :int,
126
+ :world0, :ushort,
127
+ :padding, :short,
128
+ :generation, :uint,
129
+ )
130
+ def index1 = self[:index1]
131
+ def index1=(v) self[:index1] = v end
132
+ def world0 = self[:world0]
133
+ def world0=(v) self[:world0] = v end
134
+ def padding = self[:padding]
135
+ def padding=(v) self[:padding] = v end
136
+ def generation = self[:generation]
137
+ def generation=(v) self[:generation] = v end
138
+ def self.create_as(_index1_, _world0_, _padding_, _generation_)
139
+ instance = ContactId.new
140
+ instance[:index1] = _index1_
141
+ instance[:world0] = _world0_
142
+ instance[:padding] = _padding_
143
+ instance[:generation] = _generation_
144
+ instance
145
+ end
146
+ end
147
+
123
148
 
124
149
  # Function
125
150
 
@@ -24,14 +24,7 @@ module Box2D
24
24
 
25
25
  def self.setup_id_inline_symbols(method_naming: :original)
26
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],
27
+ [:StoreContactId, :b2StoreContactId, [ContactId.by_value, :pointer], :int],
35
28
  ]
36
29
  entries.each do |entry|
37
30
  api_name = if method_naming == :snake_case
data/lib/box2d_main.rb CHANGED
@@ -32,6 +32,7 @@ module Box2D
32
32
  [:World_GetBodyEvents, :b2World_GetBodyEvents, [WorldId.by_value], BodyEvents.by_value],
33
33
  [:World_GetSensorEvents, :b2World_GetSensorEvents, [WorldId.by_value], SensorEvents.by_value],
34
34
  [:World_GetContactEvents, :b2World_GetContactEvents, [WorldId.by_value], ContactEvents.by_value],
35
+ [:World_GetJointEvents, :b2World_GetJointEvents, [WorldId.by_value], JointEvents.by_value],
35
36
  [:World_OverlapAABB, :b2World_OverlapAABB, [WorldId.by_value, AABB.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
36
37
  [:World_OverlapShape, :b2World_OverlapShape, [WorldId.by_value, :pointer, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
37
38
  [:World_CastRay, :b2World_CastRay, [WorldId.by_value, Vec2.by_value, Vec2.by_value, QueryFilter.by_value, :pointer, :pointer], TreeStats.by_value],
@@ -53,7 +54,6 @@ module Box2D
53
54
  [:World_GetGravity, :b2World_GetGravity, [WorldId.by_value], Vec2.by_value],
54
55
  [:World_Explode, :b2World_Explode, [WorldId.by_value, :pointer], :void],
55
56
  [:World_SetContactTuning, :b2World_SetContactTuning, [WorldId.by_value, :float, :float, :float], :void],
56
- [:World_SetJointTuning, :b2World_SetJointTuning, [WorldId.by_value, :float, :float], :void],
57
57
  [:World_SetMaximumLinearSpeed, :b2World_SetMaximumLinearSpeed, [WorldId.by_value, :float], :void],
58
58
  [:World_GetMaximumLinearSpeed, :b2World_GetMaximumLinearSpeed, [WorldId.by_value], :float],
59
59
  [:World_EnableWarmStarting, :b2World_EnableWarmStarting, [WorldId.by_value, :bool], :void],
@@ -89,12 +89,13 @@ module Box2D
89
89
  [:Body_GetAngularVelocity, :b2Body_GetAngularVelocity, [BodyId.by_value], :float],
90
90
  [:Body_SetLinearVelocity, :b2Body_SetLinearVelocity, [BodyId.by_value, Vec2.by_value], :void],
91
91
  [:Body_SetAngularVelocity, :b2Body_SetAngularVelocity, [BodyId.by_value, :float], :void],
92
- [:Body_SetTargetTransform, :b2Body_SetTargetTransform, [BodyId.by_value, Transform.by_value, :float], :void],
92
+ [:Body_SetTargetTransform, :b2Body_SetTargetTransform, [BodyId.by_value, Transform.by_value, :float, :bool], :void],
93
93
  [:Body_GetLocalPointVelocity, :b2Body_GetLocalPointVelocity, [BodyId.by_value, Vec2.by_value], Vec2.by_value],
94
94
  [:Body_GetWorldPointVelocity, :b2Body_GetWorldPointVelocity, [BodyId.by_value, Vec2.by_value], Vec2.by_value],
95
95
  [:Body_ApplyForce, :b2Body_ApplyForce, [BodyId.by_value, Vec2.by_value, Vec2.by_value, :bool], :void],
96
96
  [:Body_ApplyForceToCenter, :b2Body_ApplyForceToCenter, [BodyId.by_value, Vec2.by_value, :bool], :void],
97
97
  [:Body_ApplyTorque, :b2Body_ApplyTorque, [BodyId.by_value, :float, :bool], :void],
98
+ [:Body_ClearForces, :b2Body_ClearForces, [BodyId.by_value], :void],
98
99
  [:Body_ApplyLinearImpulse, :b2Body_ApplyLinearImpulse, [BodyId.by_value, Vec2.by_value, Vec2.by_value, :bool], :void],
99
100
  [:Body_ApplyLinearImpulseToCenter, :b2Body_ApplyLinearImpulseToCenter, [BodyId.by_value, Vec2.by_value, :bool], :void],
100
101
  [:Body_ApplyAngularImpulse, :b2Body_ApplyAngularImpulse, [BodyId.by_value, :float, :bool], :void],
@@ -113,6 +114,7 @@ module Box2D
113
114
  [:Body_GetGravityScale, :b2Body_GetGravityScale, [BodyId.by_value], :float],
114
115
  [:Body_IsAwake, :b2Body_IsAwake, [BodyId.by_value], :bool],
115
116
  [:Body_SetAwake, :b2Body_SetAwake, [BodyId.by_value, :bool], :void],
117
+ [:Body_WakeTouching, :b2Body_WakeTouching, [BodyId.by_value], :void],
116
118
  [:Body_EnableSleep, :b2Body_EnableSleep, [BodyId.by_value, :bool], :void],
117
119
  [:Body_IsSleepEnabled, :b2Body_IsSleepEnabled, [BodyId.by_value], :bool],
118
120
  [:Body_SetSleepThreshold, :b2Body_SetSleepThreshold, [BodyId.by_value, :float], :void],
@@ -120,8 +122,8 @@ module Box2D
120
122
  [:Body_IsEnabled, :b2Body_IsEnabled, [BodyId.by_value], :bool],
121
123
  [:Body_Disable, :b2Body_Disable, [BodyId.by_value], :void],
122
124
  [:Body_Enable, :b2Body_Enable, [BodyId.by_value], :void],
123
- [:Body_SetFixedRotation, :b2Body_SetFixedRotation, [BodyId.by_value, :bool], :void],
124
- [:Body_IsFixedRotation, :b2Body_IsFixedRotation, [BodyId.by_value], :bool],
125
+ [:Body_SetMotionLocks, :b2Body_SetMotionLocks, [BodyId.by_value, MotionLocks.by_value], :void],
126
+ [:Body_GetMotionLocks, :b2Body_GetMotionLocks, [BodyId.by_value], MotionLocks.by_value],
125
127
  [:Body_SetBullet, :b2Body_SetBullet, [BodyId.by_value, :bool], :void],
126
128
  [:Body_IsBullet, :b2Body_IsBullet, [BodyId.by_value], :bool],
127
129
  [:Body_EnableContactEvents, :b2Body_EnableContactEvents, [BodyId.by_value, :bool], :void],
@@ -152,10 +154,10 @@ module Box2D
152
154
  [:Shape_GetFriction, :b2Shape_GetFriction, [ShapeId.by_value], :float],
153
155
  [:Shape_SetRestitution, :b2Shape_SetRestitution, [ShapeId.by_value, :float], :void],
154
156
  [:Shape_GetRestitution, :b2Shape_GetRestitution, [ShapeId.by_value], :float],
155
- [:Shape_SetMaterial, :b2Shape_SetMaterial, [ShapeId.by_value, :int], :void],
156
- [:Shape_GetMaterial, :b2Shape_GetMaterial, [ShapeId.by_value], :int],
157
+ [:Shape_SetUserMaterial, :b2Shape_SetUserMaterial, [ShapeId.by_value, :ulong_long], :void],
158
+ [:Shape_GetUserMaterial, :b2Shape_GetUserMaterial, [ShapeId.by_value], :ulong_long],
159
+ [:Shape_SetSurfaceMaterial, :b2Shape_SetSurfaceMaterial, [ShapeId.by_value, :pointer], :void],
157
160
  [:Shape_GetSurfaceMaterial, :b2Shape_GetSurfaceMaterial, [ShapeId.by_value], SurfaceMaterial.by_value],
158
- [:Shape_SetSurfaceMaterial, :b2Shape_SetSurfaceMaterial, [ShapeId.by_value, SurfaceMaterial.by_value], :void],
159
161
  [:Shape_GetFilter, :b2Shape_GetFilter, [ShapeId.by_value], Filter.by_value],
160
162
  [:Shape_SetFilter, :b2Shape_SetFilter, [ShapeId.by_value, Filter.by_value], :void],
161
163
  [:Shape_EnableSensorEvents, :b2Shape_EnableSensorEvents, [ShapeId.by_value, :bool], :void],
@@ -181,30 +183,30 @@ module Box2D
181
183
  [:Shape_GetContactCapacity, :b2Shape_GetContactCapacity, [ShapeId.by_value], :int],
182
184
  [:Shape_GetContactData, :b2Shape_GetContactData, [ShapeId.by_value, :pointer, :int], :int],
183
185
  [:Shape_GetSensorCapacity, :b2Shape_GetSensorCapacity, [ShapeId.by_value], :int],
184
- [:Shape_GetSensorOverlaps, :b2Shape_GetSensorOverlaps, [ShapeId.by_value, :pointer, :int], :int],
186
+ [:Shape_GetSensorData, :b2Shape_GetSensorData, [ShapeId.by_value, :pointer, :int], :int],
185
187
  [:Shape_GetAABB, :b2Shape_GetAABB, [ShapeId.by_value], AABB.by_value],
186
- [:Shape_GetMassData, :b2Shape_GetMassData, [ShapeId.by_value], MassData.by_value],
188
+ [:Shape_ComputeMassData, :b2Shape_ComputeMassData, [ShapeId.by_value], MassData.by_value],
187
189
  [:Shape_GetClosestPoint, :b2Shape_GetClosestPoint, [ShapeId.by_value, Vec2.by_value], Vec2.by_value],
190
+ [:Shape_ApplyWind, :b2Shape_ApplyWind, [ShapeId.by_value, Vec2.by_value, :float, :float, :bool], :void],
188
191
  [:CreateChain, :b2CreateChain, [BodyId.by_value, :pointer], ChainId.by_value],
189
192
  [:DestroyChain, :b2DestroyChain, [ChainId.by_value], :void],
190
193
  [:Chain_GetWorld, :b2Chain_GetWorld, [ChainId.by_value], WorldId.by_value],
191
194
  [:Chain_GetSegmentCount, :b2Chain_GetSegmentCount, [ChainId.by_value], :int],
192
195
  [:Chain_GetSegments, :b2Chain_GetSegments, [ChainId.by_value, :pointer, :int], :int],
193
- [:Chain_SetFriction, :b2Chain_SetFriction, [ChainId.by_value, :float], :void],
194
- [:Chain_GetFriction, :b2Chain_GetFriction, [ChainId.by_value], :float],
195
- [:Chain_SetRestitution, :b2Chain_SetRestitution, [ChainId.by_value, :float], :void],
196
- [:Chain_GetRestitution, :b2Chain_GetRestitution, [ChainId.by_value], :float],
197
- [:Chain_SetMaterial, :b2Chain_SetMaterial, [ChainId.by_value, :int], :void],
198
- [:Chain_GetMaterial, :b2Chain_GetMaterial, [ChainId.by_value], :int],
196
+ [:Chain_GetSurfaceMaterialCount, :b2Chain_GetSurfaceMaterialCount, [ChainId.by_value], :int],
197
+ [:Chain_SetSurfaceMaterial, :b2Chain_SetSurfaceMaterial, [ChainId.by_value, :pointer, :int], :void],
198
+ [:Chain_GetSurfaceMaterial, :b2Chain_GetSurfaceMaterial, [ChainId.by_value, :int], SurfaceMaterial.by_value],
199
199
  [:Chain_IsValid, :b2Chain_IsValid, [ChainId.by_value], :bool],
200
- [:DestroyJoint, :b2DestroyJoint, [JointId.by_value], :void],
200
+ [:DestroyJoint, :b2DestroyJoint, [JointId.by_value, :bool], :void],
201
201
  [:Joint_IsValid, :b2Joint_IsValid, [JointId.by_value], :bool],
202
202
  [:Joint_GetType, :b2Joint_GetType, [JointId.by_value], :int],
203
203
  [:Joint_GetBodyA, :b2Joint_GetBodyA, [JointId.by_value], BodyId.by_value],
204
204
  [:Joint_GetBodyB, :b2Joint_GetBodyB, [JointId.by_value], BodyId.by_value],
205
205
  [:Joint_GetWorld, :b2Joint_GetWorld, [JointId.by_value], WorldId.by_value],
206
- [:Joint_GetLocalAnchorA, :b2Joint_GetLocalAnchorA, [JointId.by_value], Vec2.by_value],
207
- [:Joint_GetLocalAnchorB, :b2Joint_GetLocalAnchorB, [JointId.by_value], Vec2.by_value],
206
+ [:Joint_SetLocalFrameA, :b2Joint_SetLocalFrameA, [JointId.by_value, Transform.by_value], :void],
207
+ [:Joint_GetLocalFrameA, :b2Joint_GetLocalFrameA, [JointId.by_value], Transform.by_value],
208
+ [:Joint_SetLocalFrameB, :b2Joint_SetLocalFrameB, [JointId.by_value, Transform.by_value], :void],
209
+ [:Joint_GetLocalFrameB, :b2Joint_GetLocalFrameB, [JointId.by_value], Transform.by_value],
208
210
  [:Joint_SetCollideConnected, :b2Joint_SetCollideConnected, [JointId.by_value, :bool], :void],
209
211
  [:Joint_GetCollideConnected, :b2Joint_GetCollideConnected, [JointId.by_value], :bool],
210
212
  [:Joint_SetUserData, :b2Joint_SetUserData, [JointId.by_value, :pointer], :void],
@@ -212,11 +214,21 @@ module Box2D
212
214
  [:Joint_WakeBodies, :b2Joint_WakeBodies, [JointId.by_value], :void],
213
215
  [:Joint_GetConstraintForce, :b2Joint_GetConstraintForce, [JointId.by_value], Vec2.by_value],
214
216
  [:Joint_GetConstraintTorque, :b2Joint_GetConstraintTorque, [JointId.by_value], :float],
217
+ [:Joint_GetLinearSeparation, :b2Joint_GetLinearSeparation, [JointId.by_value], :float],
218
+ [:Joint_GetAngularSeparation, :b2Joint_GetAngularSeparation, [JointId.by_value], :float],
219
+ [:Joint_SetConstraintTuning, :b2Joint_SetConstraintTuning, [JointId.by_value, :float, :float], :void],
220
+ [:Joint_GetConstraintTuning, :b2Joint_GetConstraintTuning, [JointId.by_value, :pointer, :pointer], :void],
221
+ [:Joint_SetForceThreshold, :b2Joint_SetForceThreshold, [JointId.by_value, :float], :void],
222
+ [:Joint_GetForceThreshold, :b2Joint_GetForceThreshold, [JointId.by_value], :float],
223
+ [:Joint_SetTorqueThreshold, :b2Joint_SetTorqueThreshold, [JointId.by_value, :float], :void],
224
+ [:Joint_GetTorqueThreshold, :b2Joint_GetTorqueThreshold, [JointId.by_value], :float],
215
225
  [:CreateDistanceJoint, :b2CreateDistanceJoint, [WorldId.by_value, :pointer], JointId.by_value],
216
226
  [:DistanceJoint_SetLength, :b2DistanceJoint_SetLength, [JointId.by_value, :float], :void],
217
227
  [:DistanceJoint_GetLength, :b2DistanceJoint_GetLength, [JointId.by_value], :float],
218
228
  [:DistanceJoint_EnableSpring, :b2DistanceJoint_EnableSpring, [JointId.by_value, :bool], :void],
219
229
  [:DistanceJoint_IsSpringEnabled, :b2DistanceJoint_IsSpringEnabled, [JointId.by_value], :bool],
230
+ [:DistanceJoint_SetSpringForceRange, :b2DistanceJoint_SetSpringForceRange, [JointId.by_value, :float, :float], :void],
231
+ [:DistanceJoint_GetSpringForceRange, :b2DistanceJoint_GetSpringForceRange, [JointId.by_value, :pointer, :pointer], :void],
220
232
  [:DistanceJoint_SetSpringHertz, :b2DistanceJoint_SetSpringHertz, [JointId.by_value, :float], :void],
221
233
  [:DistanceJoint_SetSpringDampingRatio, :b2DistanceJoint_SetSpringDampingRatio, [JointId.by_value, :float], :void],
222
234
  [:DistanceJoint_GetSpringHertz, :b2DistanceJoint_GetSpringHertz, [JointId.by_value], :float],
@@ -235,25 +247,26 @@ module Box2D
235
247
  [:DistanceJoint_GetMaxMotorForce, :b2DistanceJoint_GetMaxMotorForce, [JointId.by_value], :float],
236
248
  [:DistanceJoint_GetMotorForce, :b2DistanceJoint_GetMotorForce, [JointId.by_value], :float],
237
249
  [:CreateMotorJoint, :b2CreateMotorJoint, [WorldId.by_value, :pointer], JointId.by_value],
238
- [:MotorJoint_SetLinearOffset, :b2MotorJoint_SetLinearOffset, [JointId.by_value, Vec2.by_value], :void],
239
- [:MotorJoint_GetLinearOffset, :b2MotorJoint_GetLinearOffset, [JointId.by_value], Vec2.by_value],
240
- [:MotorJoint_SetAngularOffset, :b2MotorJoint_SetAngularOffset, [JointId.by_value, :float], :void],
241
- [:MotorJoint_GetAngularOffset, :b2MotorJoint_GetAngularOffset, [JointId.by_value], :float],
242
- [:MotorJoint_SetMaxForce, :b2MotorJoint_SetMaxForce, [JointId.by_value, :float], :void],
243
- [:MotorJoint_GetMaxForce, :b2MotorJoint_GetMaxForce, [JointId.by_value], :float],
244
- [:MotorJoint_SetMaxTorque, :b2MotorJoint_SetMaxTorque, [JointId.by_value, :float], :void],
245
- [:MotorJoint_GetMaxTorque, :b2MotorJoint_GetMaxTorque, [JointId.by_value], :float],
246
- [:MotorJoint_SetCorrectionFactor, :b2MotorJoint_SetCorrectionFactor, [JointId.by_value, :float], :void],
247
- [:MotorJoint_GetCorrectionFactor, :b2MotorJoint_GetCorrectionFactor, [JointId.by_value], :float],
248
- [:CreateMouseJoint, :b2CreateMouseJoint, [WorldId.by_value, :pointer], JointId.by_value],
249
- [:MouseJoint_SetTarget, :b2MouseJoint_SetTarget, [JointId.by_value, Vec2.by_value], :void],
250
- [:MouseJoint_GetTarget, :b2MouseJoint_GetTarget, [JointId.by_value], Vec2.by_value],
251
- [:MouseJoint_SetSpringHertz, :b2MouseJoint_SetSpringHertz, [JointId.by_value, :float], :void],
252
- [:MouseJoint_GetSpringHertz, :b2MouseJoint_GetSpringHertz, [JointId.by_value], :float],
253
- [:MouseJoint_SetSpringDampingRatio, :b2MouseJoint_SetSpringDampingRatio, [JointId.by_value, :float], :void],
254
- [:MouseJoint_GetSpringDampingRatio, :b2MouseJoint_GetSpringDampingRatio, [JointId.by_value], :float],
255
- [:MouseJoint_SetMaxForce, :b2MouseJoint_SetMaxForce, [JointId.by_value, :float], :void],
256
- [:MouseJoint_GetMaxForce, :b2MouseJoint_GetMaxForce, [JointId.by_value], :float],
250
+ [:MotorJoint_SetLinearVelocity, :b2MotorJoint_SetLinearVelocity, [JointId.by_value, Vec2.by_value], :void],
251
+ [:MotorJoint_GetLinearVelocity, :b2MotorJoint_GetLinearVelocity, [JointId.by_value], Vec2.by_value],
252
+ [:MotorJoint_SetAngularVelocity, :b2MotorJoint_SetAngularVelocity, [JointId.by_value, :float], :void],
253
+ [:MotorJoint_GetAngularVelocity, :b2MotorJoint_GetAngularVelocity, [JointId.by_value], :float],
254
+ [:MotorJoint_SetMaxVelocityForce, :b2MotorJoint_SetMaxVelocityForce, [JointId.by_value, :float], :void],
255
+ [:MotorJoint_GetMaxVelocityForce, :b2MotorJoint_GetMaxVelocityForce, [JointId.by_value], :float],
256
+ [:MotorJoint_SetMaxVelocityTorque, :b2MotorJoint_SetMaxVelocityTorque, [JointId.by_value, :float], :void],
257
+ [:MotorJoint_GetMaxVelocityTorque, :b2MotorJoint_GetMaxVelocityTorque, [JointId.by_value], :float],
258
+ [:MotorJoint_SetLinearHertz, :b2MotorJoint_SetLinearHertz, [JointId.by_value, :float], :void],
259
+ [:MotorJoint_GetLinearHertz, :b2MotorJoint_GetLinearHertz, [JointId.by_value], :float],
260
+ [:MotorJoint_SetLinearDampingRatio, :b2MotorJoint_SetLinearDampingRatio, [JointId.by_value, :float], :void],
261
+ [:MotorJoint_GetLinearDampingRatio, :b2MotorJoint_GetLinearDampingRatio, [JointId.by_value], :float],
262
+ [:MotorJoint_SetAngularHertz, :b2MotorJoint_SetAngularHertz, [JointId.by_value, :float], :void],
263
+ [:MotorJoint_GetAngularHertz, :b2MotorJoint_GetAngularHertz, [JointId.by_value], :float],
264
+ [:MotorJoint_SetAngularDampingRatio, :b2MotorJoint_SetAngularDampingRatio, [JointId.by_value, :float], :void],
265
+ [:MotorJoint_GetAngularDampingRatio, :b2MotorJoint_GetAngularDampingRatio, [JointId.by_value], :float],
266
+ [:MotorJoint_SetMaxSpringForce, :b2MotorJoint_SetMaxSpringForce, [JointId.by_value, :float], :void],
267
+ [:MotorJoint_GetMaxSpringForce, :b2MotorJoint_GetMaxSpringForce, [JointId.by_value], :float],
268
+ [:MotorJoint_SetMaxSpringTorque, :b2MotorJoint_SetMaxSpringTorque, [JointId.by_value, :float], :void],
269
+ [:MotorJoint_GetMaxSpringTorque, :b2MotorJoint_GetMaxSpringTorque, [JointId.by_value], :float],
257
270
  [:CreateFilterJoint, :b2CreateFilterJoint, [WorldId.by_value, :pointer], JointId.by_value],
258
271
  [:CreatePrismaticJoint, :b2CreatePrismaticJoint, [WorldId.by_value, :pointer], JointId.by_value],
259
272
  [:PrismaticJoint_EnableSpring, :b2PrismaticJoint_EnableSpring, [JointId.by_value, :bool], :void],
@@ -262,6 +275,8 @@ module Box2D
262
275
  [:PrismaticJoint_GetSpringHertz, :b2PrismaticJoint_GetSpringHertz, [JointId.by_value], :float],
263
276
  [:PrismaticJoint_SetSpringDampingRatio, :b2PrismaticJoint_SetSpringDampingRatio, [JointId.by_value, :float], :void],
264
277
  [:PrismaticJoint_GetSpringDampingRatio, :b2PrismaticJoint_GetSpringDampingRatio, [JointId.by_value], :float],
278
+ [:PrismaticJoint_SetTargetTranslation, :b2PrismaticJoint_SetTargetTranslation, [JointId.by_value, :float], :void],
279
+ [:PrismaticJoint_GetTargetTranslation, :b2PrismaticJoint_GetTargetTranslation, [JointId.by_value], :float],
265
280
  [:PrismaticJoint_EnableLimit, :b2PrismaticJoint_EnableLimit, [JointId.by_value, :bool], :void],
266
281
  [:PrismaticJoint_IsLimitEnabled, :b2PrismaticJoint_IsLimitEnabled, [JointId.by_value], :bool],
267
282
  [:PrismaticJoint_GetLowerLimit, :b2PrismaticJoint_GetLowerLimit, [JointId.by_value], :float],
@@ -283,6 +298,8 @@ module Box2D
283
298
  [:RevoluteJoint_GetSpringHertz, :b2RevoluteJoint_GetSpringHertz, [JointId.by_value], :float],
284
299
  [:RevoluteJoint_SetSpringDampingRatio, :b2RevoluteJoint_SetSpringDampingRatio, [JointId.by_value, :float], :void],
285
300
  [:RevoluteJoint_GetSpringDampingRatio, :b2RevoluteJoint_GetSpringDampingRatio, [JointId.by_value], :float],
301
+ [:RevoluteJoint_SetTargetAngle, :b2RevoluteJoint_SetTargetAngle, [JointId.by_value, :float], :void],
302
+ [:RevoluteJoint_GetTargetAngle, :b2RevoluteJoint_GetTargetAngle, [JointId.by_value], :float],
286
303
  [:RevoluteJoint_GetAngle, :b2RevoluteJoint_GetAngle, [JointId.by_value], :float],
287
304
  [:RevoluteJoint_EnableLimit, :b2RevoluteJoint_EnableLimit, [JointId.by_value, :bool], :void],
288
305
  [:RevoluteJoint_IsLimitEnabled, :b2RevoluteJoint_IsLimitEnabled, [JointId.by_value], :bool],
@@ -297,8 +314,6 @@ module Box2D
297
314
  [:RevoluteJoint_SetMaxMotorTorque, :b2RevoluteJoint_SetMaxMotorTorque, [JointId.by_value, :float], :void],
298
315
  [:RevoluteJoint_GetMaxMotorTorque, :b2RevoluteJoint_GetMaxMotorTorque, [JointId.by_value], :float],
299
316
  [:CreateWeldJoint, :b2CreateWeldJoint, [WorldId.by_value, :pointer], JointId.by_value],
300
- [:WeldJoint_GetReferenceAngle, :b2WeldJoint_GetReferenceAngle, [JointId.by_value], :float],
301
- [:WeldJoint_SetReferenceAngle, :b2WeldJoint_SetReferenceAngle, [JointId.by_value, :float], :void],
302
317
  [:WeldJoint_SetLinearHertz, :b2WeldJoint_SetLinearHertz, [JointId.by_value, :float], :void],
303
318
  [:WeldJoint_GetLinearHertz, :b2WeldJoint_GetLinearHertz, [JointId.by_value], :float],
304
319
  [:WeldJoint_SetLinearDampingRatio, :b2WeldJoint_SetLinearDampingRatio, [JointId.by_value, :float], :void],
@@ -326,6 +341,8 @@ module Box2D
326
341
  [:WheelJoint_SetMaxMotorTorque, :b2WheelJoint_SetMaxMotorTorque, [JointId.by_value, :float], :void],
327
342
  [:WheelJoint_GetMaxMotorTorque, :b2WheelJoint_GetMaxMotorTorque, [JointId.by_value], :float],
328
343
  [:WheelJoint_GetMotorTorque, :b2WheelJoint_GetMotorTorque, [JointId.by_value], :float],
344
+ [:Contact_IsValid, :b2Contact_IsValid, [ContactId.by_value], :bool],
345
+ [:Contact_GetData, :b2Contact_GetData, [ContactId.by_value], ContactData.by_value],
329
346
  ]
330
347
  entries.each do |entry|
331
348
  api_name = if method_naming == :snake_case
@@ -143,14 +143,15 @@ module Box2D
143
143
 
144
144
  def self.setup_math_functions_symbols(method_naming: :original)
145
145
  entries = [
146
- [:Atan2, :b2Atan2, [:float, :float], :float],
147
- [:ComputeCosSin, :b2ComputeCosSin, [:float], CosSin.by_value],
148
- [:ComputeRotationBetweenUnitVectors, :b2ComputeRotationBetweenUnitVectors, [Vec2.by_value, Vec2.by_value], Rot.by_value],
149
146
  [:IsValidFloat, :b2IsValidFloat, [:float], :bool],
150
147
  [:IsValidVec2, :b2IsValidVec2, [Vec2.by_value], :bool],
151
148
  [:IsValidRotation, :b2IsValidRotation, [Rot.by_value], :bool],
149
+ [:IsValidTransform, :b2IsValidTransform, [Transform.by_value], :bool],
152
150
  [:IsValidAABB, :b2IsValidAABB, [AABB.by_value], :bool],
153
151
  [:IsValidPlane, :b2IsValidPlane, [Plane.by_value], :bool],
152
+ [:Atan2, :b2Atan2, [:float, :float], :float],
153
+ [:ComputeCosSin, :b2ComputeCosSin, [:float], CosSin.by_value],
154
+ [:ComputeRotationBetweenUnitVectors, :b2ComputeRotationBetweenUnitVectors, [Vec2.by_value, Vec2.by_value], Rot.by_value],
154
155
  [:SetLengthUnitsPerMeter, :b2SetLengthUnitsPerMeter, [:float], :void],
155
156
  [:GetLengthUnitsPerMeter, :b2GetLengthUnitsPerMeter, [], :float],
156
157
  ]
@@ -60,7 +60,9 @@ module Box2D
60
60
  [:LengthSquared, :b2LengthSquared, [Vec2.by_value], :float],
61
61
  [:DistanceSquared, :b2DistanceSquared, [Vec2.by_value, Vec2.by_value], :float],
62
62
  [:MakeRot, :b2MakeRot, [:float], Rot.by_value],
63
+ [:MakeRotFromUnitVector, :b2MakeRotFromUnitVector, [Vec2.by_value], Rot.by_value],
63
64
  [:IsNormalizedRot, :b2IsNormalizedRot, [Rot.by_value], :bool],
65
+ [:InvertRot, :b2InvertRot, [Rot.by_value], Rot.by_value],
64
66
  [:NLerp, :b2NLerp, [Rot.by_value, Rot.by_value, :float], Rot.by_value],
65
67
  [:ComputeAngularVelocity, :b2ComputeAngularVelocity, [Rot.by_value, Rot.by_value, :float], :float],
66
68
  [:Rot_GetAngle, :b2Rot_GetAngle, [Rot.by_value], :float],
@@ -70,7 +72,6 @@ module Box2D
70
72
  [:InvMulRot, :b2InvMulRot, [Rot.by_value, Rot.by_value], Rot.by_value],
71
73
  [:RelativeAngle, :b2RelativeAngle, [Rot.by_value, Rot.by_value], :float],
72
74
  [:UnwindAngle, :b2UnwindAngle, [:float], :float],
73
- [:UnwindLargeAngle, :b2UnwindLargeAngle, [:float], :float],
74
75
  [:RotateVector, :b2RotateVector, [Rot.by_value, Vec2.by_value], Vec2.by_value],
75
76
  [:InvRotateVector, :b2InvRotateVector, [Rot.by_value, Vec2.by_value], Vec2.by_value],
76
77
  [:TransformPoint, :b2TransformPoint, [Transform.by_value, Vec2.by_value], Vec2.by_value],
@@ -87,6 +88,7 @@ module Box2D
87
88
  [:AABB_Overlaps, :b2AABB_Overlaps, [AABB.by_value, AABB.by_value], :bool],
88
89
  [:MakeAABB, :b2MakeAABB, [:pointer, :int, :float], AABB.by_value],
89
90
  [:PlaneSeparation, :b2PlaneSeparation, [Plane.by_value, Vec2.by_value], :float],
91
+ [:SpringDamper, :b2SpringDamper, [:float, :float, :float, :float, :float], :float],
90
92
  ]
91
93
  entries.each do |entry|
92
94
  api_name = if method_naming == :snake_case